Home Forums Chart Support array


Viewing 4 posts - 1 through 4 (of 4 total)
  • #36071

    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



    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]});     
    chart.options.data[0].dataPoints = dps;

    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/



    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.

    Adithya Menon
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.