chapkovski
Posts: 9
Joined: Fri Apr 30, 2021 7:45 am

Some unnecessary smoothing happens in stocks

Thu Feb 10, 2022 2:33 pm

I am not sure if I describe the problem correctly, but I'll be happy to provide raw data and more explanations.

We have a data (available here: https://blocke-channels-bucket.s3.amazo ... beled.json).

Sometimes it has some sharp jumps in it (most likely when the data collector was off/broken or whatever).

If we plot this in python for example it looks like that:

Image

So it can be clearly seen that around June 5th 2020 there was a drop to 0.

But the same area rendered in Highcharts smooths this out:

Image

You can see it in live rendering here: https://chapkovski.github.io/anomaly_tr ... 4135800000

What's happening here, and can we make the rendering similar to what we have in Python?

Thanks a lot in advance!


magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Some unnecessary smoothing happens in stocks

Fri Feb 11, 2022 2:01 pm

Hi,

Thanks for contacting us with your question!

I suppose it is caused by dataGrouping. In the Highcharts API we can read:
plotOptions.line.dataGrouping

Data grouping is the concept of sampling the data values into larger blocks in order to ease readability and increase the performance of the JavaScript charts. Highstock by default applies data grouping when the points become closer than a certain pixel value, determined by the groupPixelWidth option.

You can disable the dataGrouping in the following way:

Code: Select all

plotOptions: {
    series: {
        dataGrouping: {
            enabled: false
        }
    }
},

API Reference:
https://api.highcharts.com/highstock/pl ... taGrouping

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

Let me know if that was what you were looking for,
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

chapkovski
Posts: 9
Joined: Fri Apr 30, 2021 7:45 am

Re: Some unnecessary smoothing happens in stocks

Fri Feb 11, 2022 2:04 pm

hi, thanks a lot! That exactly what I was looking for.

magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Some unnecessary smoothing happens in stocks

Fri Feb 11, 2022 2:19 pm

You're welcome! In case of any further questions, feel free to contact us again.
Magdalena Gut
Developer and Highcharts Support Engineer

TimeBomb
Posts: 1
Joined: Tue Jul 04, 2023 10:10 am

Re: Some unnecessary smoothing happens in stocks

Tue Jul 04, 2023 10:11 am

Anything like this for 2023? Thanks!

jakub.s
Posts: 976
Joined: Fri Dec 16, 2022 11:45 am

Re: Some unnecessary smoothing happens in stocks

Tue Jul 04, 2023 12:39 pm

Hi @TimeBomb,

Welcome to our forum!

Could you please elaborate on your question?

Here's a demo showing dataGrouping disabled in case that's what you're looking for: https://jsfiddle.net/BlackLabel/f6emq4zd/

Best regards!
Jakub
Highcharts Developer

Return to “Highcharts Stock”