Page 1 of 1

A Question About Data Insert in Series

Posted: Sat Dec 23, 2006 2:42 am
by 9348298
I insert several series (TSurfaceSeries) in the Chart1(TChart of Delphi 7.0, TeeChart7.07), when I input the code as:
chart1.series[0].addxyz(0,1,0);
chart1.series[1].addxyz(0,2,0);
the data cann’t be accepted ,and the error notice is “ undeclared identifier: ‘addxyz’ ” .
the data can be accepted with follow code :
series1.addxyz(0,1,0);
series2.addxyz(0,2,0);
But if I want to do a cycle for all of the series, should I do it one by one? Thank you!

Posted: Sat Dec 23, 2006 11:07 am
by Marjan
Hi.

tChart.Series is defined as TChartSeries and it doesn't introduce AddXYZ method. To make it work, you'll have to typecast TChartSeries to TSurfaceSeries (of course, if possible). Something like this:

Code: Select all

if (tChart.Series[0] is TSurfaceSeries) then
with (tChart.Series[0] as TSurfaceSeries) do
begin
  AddXYZ(...);
end;