ted
ted

Reputation: 57

What's the good solution to display huge data on jqplot line?

I'm using jqplot for my chart. As you can see the picture I attached. The data used in chart is 1458 points, and it's look like I have fulfilled the chart with the ball blue color.

enter image description here

I'm looking for a solution to make it look better, even if I use more than 100,000 points. So, Could you please tell me a good solution to solve this issue? I really appreciate any your idea about it

After replot with _databound min and max enter image description here

Upvotes: 0

Views: 955

Answers (1)

AnthonyLeGovic
AnthonyLeGovic

Reputation: 2335

You can get your dataBounds value after rendering using :

var minX = plot.axes.xaxis._dataBounds.min;
var maxX = plot.axes.xaxis._dataBounds.max;

(You can get minY and maxY similarly using yaxis.)

Then you can ask jqplot to use this bounds to plot exact range using :

plot.axes.xaxis.min = minX;
plot.axes.xaxis.max = maxX;

(Again act similarly for yaxis);

Finally, replot your graph : plot.replot();

Your final graph has bounds according to your data values and thus no useless blank on both sides.

Upvotes: 2

Related Questions