jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: point markers disappearing after series data update

Hey,

There is no built-in Highcharts functionality to do that but I managed to do it using SVGRenderer. I removed connections between points in the line series and draw new ones using renderer.path. They update along with the chart to you don't need to worry that they will be missaligned.

Demo: https://codesandbox.io/s/priceless-danny-1xp9cg

I hope you will find it useful
Best regards
Jakub
miguel.picoleal
Posts: 8
Joined: Fri Mar 03, 2023 5:10 pm

Re: point markers disappearing after series data update

Nice, it does look great, pretty recursive.

I am going to append here an example with bars too since that's how my whole chart is going to look like.

Demo: https://codesandbox.io/s/quiet-wildflow ... BarLine.js

Do you know if there is a way to not have the bars overlap the lines ?

As it is right now, the bars are on top of the lines. But I am more interested in seeing the lines than the bars.

I tried changing the order of elements pushed to my chartData arr but still the bars overlap the lines.

Best regards
Miguel A.
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: point markers disappearing after series data update

Hey,
I'm happy to hear that my solution works for you.

To show the lines on top of the bars, you can easily do it by adding zIndex property to chart.renderer.attr().
You can also manipulate if you want the pink line or the purple line be on top of each other, the one with bigger zIndex value will be shown first.

Demo: https://codesandbox.io/s/charming-night-tfs0gv

I hope you will find it useful
Best regards
Jakub
miguel.picoleal
Posts: 8
Joined: Fri Mar 03, 2023 5:10 pm

Re: point markers disappearing after series data update

That's great it works.

Do you know if there is a way to actually hide certain points that are just above my limit ?

The reason I ask is because you can see for the example we have that there is going to be some space between my 200k limit and the actual end of my graph(320k), so If I were to have more points greater that 200k but still smaller than 320k which is the end of my graph, they would still be displayed in that space.

That's why I want to hide them,

https://snipboard.io/gMacyv.jpg

Thanks again Jakub : )
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: point markers disappearing after series data update

Hey,

Unfortunately, I can't see your image, it doesn't load, you can try to use imgur.com to upload it.

I think, I know what you are trying to do, without seeing the image, please let me know if I was correct.
Each point has a visible property, so you can just use update() method and change the visible property to false.
I looped over your chart.series and found the points which yValue > 200k and changed their visibility.

API:
https://api.highcharts.com/class-refere ... nt#visible
https://api.highcharts.com/class-refere ... int#update

Demo: https://codesandbox.io/s/sweet-rui-8m4cqc

Let me know if that was what you were looking for!
Best regards
Jakub

Return to “Highcharts Usage”