rushikesh
Posts: 31
Joined: Wed Jul 20, 2022 10:14 am

Re: setting effective timeline in highstocks

in other words, when I don't apply above solution, chart looks beautify and shiny even if I change the range using navigator. So, I expect that it does not impact existing view and still I achieve the exclusion of weekend days.
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: setting effective timeline in highstocks

It seems that this issue is related to defaultly enabled dataGrouping, which tries to squezze the points in order to present them better. The xAxis.breaks works fine and since such implementation as in you case is quite rare, I would suggest to tweak the distance with pointPadding and groupPadding properties. You could also disable dataGrouping, but it will render all points as they are, making the chart less clear on bigger time spans.

Demo: https://jsfiddle.net/BlackLabel/3sqrpuL1/

API:
https://api.highcharts.com/highstock/se ... intPadding
https://api.highcharts.com/highstock/se ... oupPadding

Let me know if you have any more questions.
Best regards!
Jędrzej Ruta
Highcharts Developer
rushikesh
Posts: 31
Joined: Wed Jul 20, 2022 10:14 am

Re: setting effective timeline in highstocks

thanks jedrzej,
however, what does pointPadding docs exactly mean that I am not able to understand. it says : "Padding between each column or bar, in x axis units." what does in x axis units mean? in above demo project, what is the value of "x axis units"?
can you please explain using above demo project?
if we consider value, 0.3 of pointPadding, to which value's relative it is? to which value I multiply 0.3 to get the padding value?
same I feel for groupPadding.
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: setting effective timeline in highstocks

The x axis units don't refer to any specific measurement, since the tickInterval and tickPositions are calculated based on data provided. Than, the point metrics are calculated by taking many factors into account (such as point width and density of points) in order to maintain clarity of the chart and to avoid overlapping. I would suggest playing around with these values, so you can get a satisfying outcome.

Let me know if you happen to have any more questions.
Best regards!
Jędrzej Ruta
Highcharts Developer
rushikesh
Posts: 31
Joined: Wed Jul 20, 2022 10:14 am

Re: setting effective timeline in highstocks

Consider a demo project : https://jsfiddle.net/zs9uq7xf
Here, Ordinal is set to true and it is with breaks.
But candles are not well-placed as they used be when not using breaks.
So, is not it a bug that they are not well placed when using x.breaks?
If it is not a bug, then this thing should be properly documented in highcharts.
Solving by groupPadding and pointPadding is understandable. But is not it possible to have beautiful chart by default when graph is loaded when using ordinal set to true and with breaks?

Also, by last answer to explain x axis units with regards to groupPadding and pointPadding is not still understandable to me.
If i put grouppadding or pointPadding to 0.4, to which relative to 0.4 is? I don't want to put any value in my source code without understanding how padding is calculated?
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: setting effective timeline in highstocks

I'm sorry for any confusion, after digging further I've stumbled upon an open issue on Highcharts repository, which concludes that using breaks in column type series results in overlapping points. You can upvote this issue and leave your feedback, so that with enough user voices it might get fixed in near future.

Issue: https://github.com/highcharts/highcharts/issues/16368

As for groupPadding and pointPadding, I'd recommend taking a glance at the method responsible for calculating column metrics: https://github.com/highcharts/highchart ... #L231-L325. As you can see, all of the values are calculated dynamically, hence these properties need to be adjusted based on your config and provided data.

In case of any other questions, feel free to ask anytime.
Best regards!
Jędrzej Ruta
Highcharts Developer
rushikesh
Posts: 31
Joined: Wed Jul 20, 2022 10:14 am

Re: setting effective timeline in highstocks

Is it difficult to fix? I want to contribute in highcharts. :)
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: setting effective timeline in highstocks

Regarding your question about difficulty: If you would like to contribute and propose a fix for this issue, firstly you'd have to debug the code in order to find out what is causing the bug. After that, you can follow our contribution guide: https://github.com/highcharts/highchart ... delines.md.

If you happen to have any more questions, feel free to ask.
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Stock”