Series.Add method and DataSource property Questions
Posted: Thu Jan 11, 2007 8:32 pm
I have a couple of questions which both relate to loading data into a series.
First, there is an overload of the series.Add method which takes a List as the parameter passed in (public Void Add(System.Collections.IList)).
How does that version of the Add method work?
That list is expected to be a collection of just single values or of value pairs or something else?
If it is possible to pass in a collection of objects, how do we specify where to find the XValues and the YValues? Is it done the same way the DataSource property is documented where you use the XValues.DataMember property to give the name of the property that holds the X value?
Finally, on this subject, since this an overload of the Add method, I assume that the data found in this List is taken and copied into a new memory location for storage by the series class itself right? It does not treat that list as a data source and just refer back to the List’s memory when it needs to get the data values again.
Second, is there any detailed documentation about using the DataSource property for a series? We are interested in this because we have a DLL that handles interaction with multiple data sources. That code handles caching the data in memory and it would be nice if we could put some sort of interface onto our objects that would allow us to assign it to the DataSource property of a chart series so that there would be no need to have the data exist in our data cache as well as in the series memory space as well.
Does that make sense? What we are looking for is what we would need to implement as an interface to our objects that would allow it to serve as your DataSource for your series classes. I can try to clarify this more if needed.
Thanks again for your time.
Aaron Peronto
First, there is an overload of the series.Add method which takes a List as the parameter passed in (public Void Add(System.Collections.IList)).
How does that version of the Add method work?
That list is expected to be a collection of just single values or of value pairs or something else?
If it is possible to pass in a collection of objects, how do we specify where to find the XValues and the YValues? Is it done the same way the DataSource property is documented where you use the XValues.DataMember property to give the name of the property that holds the X value?
Finally, on this subject, since this an overload of the Add method, I assume that the data found in this List is taken and copied into a new memory location for storage by the series class itself right? It does not treat that list as a data source and just refer back to the List’s memory when it needs to get the data values again.
Second, is there any detailed documentation about using the DataSource property for a series? We are interested in this because we have a DLL that handles interaction with multiple data sources. That code handles caching the data in memory and it would be nice if we could put some sort of interface onto our objects that would allow us to assign it to the DataSource property of a chart series so that there would be no need to have the data exist in our data cache as well as in the series memory space as well.
Does that make sense? What we are looking for is what we would need to implement as an interface to our objects that would allow it to serve as your DataSource for your series classes. I can try to clarify this more if needed.
Thanks again for your time.
Aaron Peronto