Home forums Using CanvasJS Arrays in canvanjs dataplots

This topic contains 2 replies, has 2 voices, and was last updated by  junjie213 2 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #6421


    Hi guys,

    Can someone guide me on how to convert long datapoints into arrays as i have a long list to plot and i hope of an easier way to loop instead of typing x 50 times.

    Currently, i have datapoints with x which increment of .25 and y of a formula –


    dataPoints: [
    { x: 0, y: 1000*(0.5/(50*0.6))* (Math.exp(-((6)/(50*0.6)*0))) }

    link here: http://jsfiddle.net/QwZuf/95/

    Thank you!



    Hi Junjie,
    You can calculate with in a loop so that each time you have no need to put a long calculation in dataPoints. Here is a example can help you http://jsfiddle.net/anjalij/QDkdH/2/
    Please let me know if either it is works for you or if you face any problem.

    • This reply was modified 2 years, 3 months ago by  Anjali.


    Hi Anjali,

    Thank you! it helped me alot!!

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

You must be logged in to reply to this topic.