Line Chart appearing twice/multiple times when data is updated

Greetings!!

I have implementing 3 Syncfusion Cartesian Charts in a single screen.. The first charts contains 1 candle chart, 4 or 5 line charts, and 3 scatter charts.. Second chart contains 1 bar chart and the last chart contains 1 line charts and all these charts are using the same data source (Custom source).Data is coming and streams and is updated periodically. On initial load the data is perfectly rendered on the charts and displayed properly. But when the data is updated.. all the line charts start showing multiple lines along with the current data. no overlapping or duplication on bar or candle charts. I have verified that the data i am receiving is also unique (meaning there is only 1 x-axis data point corresponding to that date(y-axis)).

The main issue is with line charts rendering unnecessary line along with the main line(which infact in rendered perfectly). Kindly look into it and find the attached screenshots and .dart file.


Edit: If you provide any helper code.. make sure it is written in null safety.. Thank you!


Attachment: chart_ss_a544646f.zip


3 Replies

YG Yuvaraj Gajaraj Syncfusion Team March 3, 2022 02:11 PM UTC

Hi Ts Geek, 
 
We suspect that there might be repeated x-value in your data source, in this case only the reported scenario will occur. We suggest using the sortingOrder and sortFieldValueMapper property in the series, that will help you to sort the data source in the ascending order. We have attached the code snippet and UG below for you reference. 
 
Code snippet: 
LineSeries( 
  //Other required property 
  sortingOrder: SortingOrder.ascending, 
  sortFieldValueMapper: (SampleData data, _) => data.x, 
) 
 
 
We hope it will help you to achieve your requirement. 
 
Regards, 
Yuvaraj. 



TG ts geek March 9, 2022 10:08 AM UTC

Hi Yuvaraj..

Thank you so much for your answer it really worked and solved my problem.

I just saw the solution and realised what i missed.

Thank you for helping out and sorry for reverting back late. :)


Regards,

TS geek 




YG Yuvaraj Gajaraj Syncfusion Team March 10, 2022 09:01 PM UTC

Hi Ts Geek, 
 
Most welcome. If you have any further query, please get back to us we are always happy to assist you. 
 
Regards, 
Yuvaraj.

Loader.
Up arrow icon