I am attempting to build a basic bar chart, but I am getting the error in the title. I have used alert() to verify that the array I want to populate the chart with holds data, but something is still not fishing out properly with the syntax. Can someone examine and let me know what I need to do better in order to make the chart produce?
var ctx = document.getElementById('cvtree').getContext('2d');
var chart = new Chart(ctx, {
type: 'bar',
data: {
labels: yoylabels,
datasets: [{
label: 'Pay By Person',
backgroundColor: 'rgba(0, 129, 214, 0.8)',
data: numericdollarvals
}]
},
options: {
},
legend: {
display: false,
position: 'top',
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
callback: function (value, index, values) {
if (parseInt(value) >= 1000) {
return '$' + value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
} else {
return '$' + value;
}
}
}
}]
}
});