Search code examples
highchartsgwt-highcharts

Representing sparse data in a Highcharts series


I'm trying to generate a stacked column chart. What I want is similar to this JSfiddle example. However, I have around 30 categories and 1000 series. The series are rather sparse. There are only about 200 values. But because highcharts needs each series to have values across the x-axis categories, I'm forced to submit 1000 series each having 30 values (mostly zeroes). The chart takes over a minute to render. How can I improve this performance?


Solution

  • There is another way you can pass the data to highcharts, where you specify x and y for each point. This means you can skip the 0 values. In the fiddle you quoted, I modified one line to be:

    data: [{x:1,y:5}, {x:3,y:7}],
    

    http://jsfiddle.net/rh9aK/

    I expect that 1000 series and 30 categories may still be too much, but this is worth a try.

    One other thing, have you made sure that you don't have any series which only contain zeros ? If so, you may as well remove them before rendering.