Home › forums › Using CanvasJS › Line chart – number of points
Can I control number of points in the simple line chart using loop?
If I want 5 points, I need to write it myself (all 5) in the code, but I want to control it with loop.
Hope someone can help me.
You can push any number of dataPoint to the chart options / data by looping through the desired data source as per your requirement. Please take a look at this JSFiddle for the same.
You must be logged in to reply to this topic.