Posted 6 July 2021, 11:46 pm EST
I have live data that I’m trying to read from several source devices. I have to read from a list of devices and determine which data channels they support at runtime, so in order to display their data in the FlexChart, I create and add new series to the FlexChart for each channel in code behind, and I set the ItemSource and Binding per series rather than for the FlexChart itself.
I want the data on the graphs to update in realtime with data streamed from my devices. I have tried several different methods of updating the ItemSource’s collection as well as updating the ItemSource and Bindings with new instances of my source data collection. The only thing that’s worked as far as getting the charts to update properly is to remove all of the series from the FlexChart and add them again with new data. This ends up being very CPU intensive and wasteful, so it is not ideal.
I keep a dictionary of each of the chart Series based on channel name. I’m able to update other properties in the series (such as Visibility) by referencing them from this dictionary just fine. The updates to the ItemSource do seem to otherwise work (Looking at the FlexChart in the Visual Studio debugger, the new data is set to each Series item source), it’s just that the updates to the ItemSource don’t trigger the chart to update with the new data. Is there anyway to force this to happen? Is there an alternative to what I’m trying to achieve?