Warm tip: This article is reproduced from stackoverflow.com, please click
highcharts javascript

Is there any option in Highcharts for simplifyng a line graph?

发布于 2020-03-27 10:19:17

I´m setting up a preview for a graph, and I want to know if highcharts has any option for reducing the number of points showed in a series. I have points everyday in 5 years, and I would like to reduce for a simple preview. Is this possible?

enter image description here

Questioner
jfmarquez
Viewed
76
ppotaczek 2019-07-03 22:33

You can reduce the number of points by your own function, but I think that the best solution will be to use provided by Highstock dataGrouping feature:

series: [{
    dataGrouping: {
        enabled: true
    },
    data: [...]
}]

Live demo: http://jsfiddle.net/BlackLabel/3ky0s2oh/

API Reference: https://api.highcharts.com/highstock/plotOptions.series.dataGrouping.enabled

Docs: https://www.highcharts.com/docs/stock/data-grouping