You must be logged in to post your query.
Home › Forums › Chart Support › Label with jSON Chart
Tagged: JSON, label
Hello,
I try to create my chart when use a JSON data source like this : https://canvasjs.com/javascript-charts/json-data-api-ajax-chart/
But I have a problem to use label in X with this function :
function addData(data) { for (var i = 0; i < data.length; i++) { dataPoints.push({ x: "label":"" + data[i].heure + "", ==> problem y: data[i].units }); } chart.render(); }
How to use a label with this ?
Thanks for you help
Best Regards,
@I-TVSHOWS,
Can you kindly create jsfiddle with sample data, so that we can understand your code better and help you out?
— Vishwas R Team CanvasJS
Here is a JSfiddle : https://jsfiddle.net/xpvt214o/15829/ (But I get the impression that getJSON does not work in jsfiddle?) thanks
Sorry, error in my jsfiddle, there is the new : https://jsfiddle.net/xpvt214o/16173/
Ok, it’s fixed. I replace “x” by “label” : https://jsfiddle.net/xpvt214o/16204/
thanks
Glad that the issue was resolved :)
You must be logged in to reply to this topic. Login/Register