You must be logged in to post your query.
Home › Forums › Chart Support › array
Tagged: array, dataPoints, values
Hi, im working on my school project and i need values from array get as dataPoitns, i try a lot, but nothing was working. I need to link date to. Thank you, Domnik
Domnik,
The dataPoints must be parsed in a format accepted by CanvasJS. You can parse the dataPoints from an array and render the chart as shown in the code-snippet below,
function parseDataPoints () { for (var i = 0; i <= dataArray.length; i++) dps.push({y: dataArray[i]}); } parseDataPoints(); chart.options.data[0].dataPoints = dps; chart.render();
Kindly take a look at this JSFiddle for an example on parsing dataPoints from array and rendering the chart.
— Adithya Menon Team CanvasJS
Hi, i try it, but it is not working. I dont know what to do next. this is my code https://jsfiddle.net/Dominikbalun/nvpezc2y/3/ Dominik
Dominik,
The minimum and maximum properties are used to set the range of the X-Axis. In the code shared by you, there are no datapoints present within the axis range that you are setting. Removing the same should work fine in this case.
Kindly take a look at this updated JSFiddle for working code.
You must be logged in to reply to this topic. Login/Register