Home › forums › Using CanvasJS › How many graph points can be plotted in available space
This topic contains 1 reply, has 2 voices, and was last updated by Shashi Ranjan 2 months, 3 weeks ago.
Hello Canvas JS TEAM,
I have a dobt, how can I calculate whether how many points(ideally) can be plotted in available space(so that my graph will look good)?
Eg. I have 200px of div in which I want to plot a graph. But if I plot all the points my graph looks congested. Is there any way to calculate the available width and max allowed points for plotting.
The number of datapoints that can be displayed in 200px width chart could depends on factors like type of chart, height of the chart, etc. As an ideal scenario, you can render chart with few datapoints (lets say 10-15 datapoints) and then update it based on zoom-level with the help on rangeChanging event. Please take a look at this JSFiddle for an example on the same.
You must be logged in to reply to this topic.