beta
beta

Reputation: 5666

highcharts remove redundant data points to improve speed

i am drawing a simple line chart with highcharts. one chart can include many many points which introduces delay when playing around with the chart.

since many data-points are redundant i came up with the idea of not adding a new data-point if the value is the same as the previous one. this reduces the amount of data, but should still result in the same graph.

please see this example: http://jsfiddle.net/qm94j14t/1/ i would like to have one straight line without the data-points from February until November.

right now the data array looks like this:

data: [7,7,7,7,7,7,7,7,7,7,7,10]

What do i need to change in the code to get a straight line without these redundant 7 values?

Upvotes: 0

Views: 40

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Instead of using [y_1, y_2, ... , y_n] format, use [ [x_1, y_1], [x_2, y_2] , ... , [x_n, y_n]] format.

Then remove redundant data, demo: http://jsfiddle.net/qm94j14t/7/ So in your case it's [[0,7], [9, 7], [10, 10]].

Upvotes: 2

Related Questions