-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting groupPixelWidth to 0 in plotOptions prevents forced data grouping in rangeSelector #20913
Comments
Hi @cebamps! It is because the highcharts/ts/Extensions/DataGrouping/DataGroupingSeriesComposition.ts Lines 339 to 346 in 7b46132
I agree that when the @pawelfus |
Hello @cebamps Thanks for reporting the issue! You said:
Why do you want to set
It is not about ticks, but points' positions. I am certain, you don't want to render points 0px away from each other. |
Hello @pawelfus, thanks for your response.
My intent is to disable data grouping unless forced through range selector buttons. One representative example is a responsive chart plotting an integer value over time. Since the point density depends on what data query was performed and how narrow my responsive chart gets, there were some charts where grouping kicked in and started displaying averages where I really wanted to present integer values. I could go for a different aggregation method like computing a median, but in this scenario I would rather suffer the possible performance impact and display the actual data. This is where I expected
Yes, definitely. I just meant to highlight my first bad attempt as a workaround (if zero doesn't work, try a very small positive value), and not to make it too much of a point of focus in this issue report, because I am no longer trying to make that workaround work for me. Just to expand a little more on why this workaround did not work for me though, in case someone else is tempted by the same approach... The workaround does work to disable grouping, but it has an unfortunate consequence in the chart configuration I used, causing the browser to try and fail to allocate a huge array. I guess this might be a separate bug? Here is a demo fiddle. Clicking the button in Chrome (version 123.0.6312.59) causes this error to appear in the console after a bit (Firefox instead hangs for a few seconds then logs "Uncaught out of memory"):
After writing all this, I do realise that my approach to configuration may be a little too naive. For my use case, I think it would make sense for me to look into custom data grouping approximations to implement a form of decimation on the chart data, so that I show true data points without having to render all of them. |
Thank you for the details @cebamps !
Did you try using With Alternatively, you can use
With this config, we try to generate a group for every.. 0.000001ms. With the data range ( |
Hi @pawelfus, thanks for the suggestion. That does indeed make more sense, and working over
Right, over time my mental model for groupPixelWidth had grown into a threshold rather than the actual width of groups. When you put it the way you did, setting groupPixelWidth to a small value does indeed feel wrong 😄 |
Expected behaviour
The behaviour documented in
rangeSelector.buttons.dataGrouping.forced
should remain even whenplotOptions.line.dataGrouping.groupPixelWidth
is set to0
.Actual behaviour
When I set
plotOptions.line.dataGrouping.groupPixelWidth
to zero, my range selector buttons no longer force data grouping.As a workaround, a small non-zero
groupPixelWidth
in plotOptions works. But setting it to a very small value is not a good idea, because it is used somewhere to determine tick density in an inversely proportional way.Another workaround is to reset
groupPixelWidth
to its default value of 2 in myrangeSelector.buttons.dataGrouping
options.Live demo with steps to reproduce
https://jsfiddle.net/cedricbaptk/jx81mopf/
groupPixelWidth: 0
plotOptions configuration demonstrates the expected behaviour.Product version
Highstock 11.4.0 (latest).
Highstock 10.3.2.
Affected browser(s)
n/a
The text was updated successfully, but these errors were encountered: