When working on generating a chart using c3, I encountered an issue with accessing a Rest API in the c3 chart to load JSON data. I found guidance from this example . The problem arises when attempting to dynamically load the chart using the 'load' function, resulting in a runtime error:
Runtime Error this.chart.load is not a function
private chart: any;
this.chart = c3.generate({
data: {
url: '/api/systemvalues',
type: 'line'
}
});
setTimeout(function () {
this.chart.load({
url: '/api/systemvalues'
});
}, 1000);
The versions used for this project are:
@angular/core": "2.4.10",
"c3": "^0.4.11",
"d3": "^3.5.17",
"typescript": "2.2.2"