highcharts-react icon indicating copy to clipboard operation
highcharts-react copied to clipboard

Missing line segment when updating the series

Open whtitefall opened this issue 2 years ago • 3 comments

Hi,

I'm trying to plot a horizontal line using multiple series with a start_position and an end_position on the x-axis.

However, the entire line I'm getting missing some parts of the segments

For example,

the line segement (14,30) is missing in the graph below

image

when I print out the chartRef I found that

chart.series has a length of 5

image

chart.userOption.series has length of 6

image

This situation happens when I call setCharOptions to switch between different graphs like the one above,

which means that one of the line segments is missing when I call setChartOptions

I had this issue before, and I followed this issue to sort my line segments based on the value of start_position.

However, this time this issue happened again, and I'm not sure where I possibly did wrong.

I will post an online editor to reproduce the issue if needed.

Thank you for your time!

whtitefall avatar Sep 16 '22 21:09 whtitefall

Hi @whtitefall,

Thank you for contacting us!

The problem can be related to data mutations, so please try to disable the allowMutatingData option. If that doesn't help, please reproduce the issue in some online code editor.

API Reference: https://api.highcharts.com/highcharts/chart.allowMutatingData

ppotaczek avatar Sep 19 '22 10:09 ppotaczek

Hi,

I think I found the reason, the problem caused by the linkedTo keyword, if I'm not using the linkedTo keyword on the series, the error won't happen.

whtitefall avatar Sep 26 '22 13:09 whtitefall

You should be able to use the linkedTo property without any errors, so please add more information if you want to fully solve the problem.

ppotaczek avatar Sep 26 '22 15:09 ppotaczek

Closed due to inactivity.

ppotaczek avatar Nov 02 '22 13:11 ppotaczek