0π
β
In your code, data
is actually a dataset
and must be defined as an object but not as an array. This problem can be solved by changing var data = [];
to var data = {};
.
function addBarData(chart, d) {
var data = {};
...
}
function addPieData(chart, d) {
var data = {};
...
}
Please have a look at your amended JSFiddle.
Source:stackexchange.com