Page 1 of 1

How to Share Series Between Charts

Posted: Tue Jun 08, 2004 9:18 pm
by 9232653
I would like to share series data between multiple charts (for instance in a multi-monitor application) but don't want to simply copy the data to redundant series. I want to share the data so that each series is in memory only once. How should I do this?

Posted: Wed Jun 09, 2004 6:48 pm
by Marjan
Hi.

Hmm.... Once series is created you can control where it would be displayed by changing it's ParentChart property. The problem is ParentChart is is only single chart i.e. at the same time specific series can be displayed only on one chart.
One way around this limitation is to "copy" the values from one series to another one. Something like this:

Code: Select all

  sourceSeries.FillSampleValues(100);
  targetSeries.AssignValues(sourceSeries);
The problem with this method is the place allocated for the same data will be twice as big as for single series.

Another solution (if you don't need to show both series at the same time) is to change series ParentChart property from one chart to antoher one:

Code: Select all

series1.ParentChart := tChart1;
//switch
series1.ParentChart := tChart2;

Posted: Wed Jun 09, 2004 10:55 pm
by Pep
Hi,

there's also another solution which is to using two Series (one for each Chart) and set the DataSource of the Series2 to Series1, so when the data of Series1 will be modified will also be applied to the Series2.
Series2.DataSource := Series1;