1👍
Your barData data object should be defined before you use it, at the top, like this:
var barData = {
labels : ["January","February","March","April","May","June"],
datasets : [
{
fillColor : "#48A497",
strokeColor : "#48A4D1",
data : [456,479,324,569,702,600]
},
{
fillColor : "rgba(73,188,170,0.4)",
strokeColor : "rgba(72,174,209,0.4)",
data : [364,504,605,400,345,320]
}
]
};
var income = document.getElementById("income").getContext("2d");
new Chart(income).Bar(barData);
- [Chartjs]-Creating multiple canvas patterns fails
- [Chartjs]-How to limit number of displayed points in chart.js?
0👍
You can’t load your your chart before barData, no need to change any thing only load your chart after barData..
var barData = {
labels : ["January","February","March","April","May","June"],
datasets : [
{
fillColor : "#48A497",
strokeColor : "#48A4D1",
data : [456,479,324,569,702,600]
},
{
fillColor : "rgba(73,188,170,0.4)",
strokeColor : "rgba(72,174,209,0.4)",
data : [364,504,605,400,345,320]
}
]
};
var income = document.getElementById("income").getContext("2d");
new Chart(income).Bar(barData);
- [Chartjs]-How to create a line chart with two line, with one of them being filled, and the other staying on the foreground of the filled line?
- [Chartjs]-ChartJS xAxis label position
Source:stackexchange.com