Does anyone know how to copy the XValues from one TChartSeries to another in Delphi7 (and TeeChart 4.04)? TChartSeries.ReplaceList(CopySeries.XValues, OriginalSeries.XValues)
does not work, since it seem to replace the reference, so when OriginalSeries is changed, so is CopySeries. The length of CopySeries is equal or greater than OriginalSeries. I want to preserve the CopySeries.YValues.
My workaround has been to create a temporary list
Dummy := TChartSeries.Create(nil);
Dummy.AssignValues(OriginalSeries);
CopySeries.ReplaceList(CopySeries.XValues, Dummy.XValues);
Dummy.YValues.Destroy;
but I get a memory leakage since I cannot Destroy the Dummy since that also removes the Dummy.XValues referenced by CopySeries.XValues.
Any help is greatly appreciated.