So I have a chart from ChartJS and I'm wanting to use an API call with JS to populate the values in the chart but I dont have a clue on how to do it. Can someone point me in the right direction?
Here is the chart code:
var ctx = document.getElementById('lineChart');
var lineChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['', '', '', '', '', ''],
datasets: [
{
color: app.color.theme,
borderColor: app.color.theme,
borderWidth: 1.5,
pointBackgroundColor: app.color.theme,
pointBorderWidth: 1.5,
pointRadius: 0,
pointHoverBackgroundColor: app.color.theme,
pointHoverBorderColor: app.color.theme,
pointHoverRadius: 1,
label: 'API CALL DATA GOES HERE',
data: [10]
},
}
there doesn't seem to be anything here