ChartSeriesController id

I have a list of ChartSeriesControllers.

How do I search and fid the objectID for each controller so I will not add it to my list.

currentChartSeries = FastLineSeries<PressureReading, DateTime>(
dataSource: _listPressureReading, //myChartDataList[counter],
xValueMapper: (PressureReading currentChatData, _) =>
currentChatData.time.isUtc ? currentChatData.time.toLocal() : currentChatData.time,
yValueMapper: (PressureReading currentChatData, _) => currentChatData.value * convertPressureMBarRate,
color: currentColor,
legendItemText: split.length > 1 ? channelId : seriesname, //seriesLegendItemText[counter],
width: 0.8,
animationDuration: chartAnimationDuration,
xAxisName: "yAxisZero", // "yAxis",
onRendererCreated: (ChartSeriesController controller) {
//_mySeriesController = controller;
if (mySeriesControllerList.contains(controller)) {
} else {
mySeriesControllerList.add(controller);
}
},


It seems like mySeriesController.contains(controller) always return false.

Help 


1 Reply

SK Sriram Kiran Senthilkumar Syncfusion Team October 11, 2021 12:11 PM UTC

Hi Peter, 
  
Greetings from Syncfusion. We have analyzed your scenario with the provided code snippet at our end and we have created a simple chart sample along with a redraw button in which set state is called to refresh the chart state and, in the chart’s onRenderCreated callback, we have added the controller to the list if it not in the controller list else print a console statement when the controller is present in the list when the redraw button is clicked. Using this sample, we tried to replicate the reported issue regarding the condition to check whether the controller is in the controller list always return false and unfortunately, the controllers were getting stored properly in the list on chart redraw or refresh. We have also appended the test sample below for your reference. 
As we are not exactly sure on what scenario the issue is replicating and also we are not quite sure on what you are trying to achieve at your end, we kindly request you share with more information on your requirement in detail or on what you are trying to achieve and also if possible kindly try to replicate the reported issue with the below attached test sample and revert us with it so that it will be helpful in further analysis to provide the solutions sooner. 
 
  
Regards, 
Sriram Kiran 


Loader.
Up arrow icon