The RadCartesianChart series can be populate using two methods. The first one is to provide a collection with System.Double (or any other numeric type) values. This will populate the series with DataPoint objects (like ScatterDataPoint) which gets the Y value from the collection of System.Double and the X value is automatically set to the index of the data point. So, on the X axis you will have 1, 2, 3, etc.
The second method is to provide a collection of any object that contains two public properties that can be used from the series to get X and Y values.
In your situation, with the two collections, you have two options:
- To wrap each X/Y pair in a custom object and use the standard data binding approach. The downside of this approach is that you will hit downgrade in the performance and probably the memory footprint.
- Or instead of using the ItemsSource of the series with custom objects, you can directly populate the DataPoints collection with ScatterDataPoint objects (as you already tried). This way you will decrease the memory footprint because you will avoid creating 1 million additional objects and also you will avoid some processing time from the logic that links the custom objects with the DataPoint objects. The downside of this approach is that you will need to manually synchronize both collections with X and Y values with the DataPoints collection of the chart.
As for the capacity of the DataPoints collection, I am afraid there is no API that allows setting this.
I hope this answers your questions. If you have any others, please let me know.
Progress is here for your business, like always. Read more
about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.