Only first point of a series in different color
Posted: Fri Apr 29, 2011 10:07 am
Hello,
I have transferred a Delphi software project using TeeChart Pro from TeeChart version 7 (and BDS 2006) to TeeChart version 2010 (and RAD-Studio 2010). Now everything worked fine except of one (little?) problem:
The following code fragment should color each point of a LineSeries in a different color, depending on the value of SpecViolationLevel (0..3):
Now the problem is, that when starting the application with the new TeeChart 2010 only the first point of the series is colored in the expected color (e.g. yellow, if its SpecViolationLevel=1), the other points remain in the basic color of the series (blue in the example above). In former times (i.e. with TeeChart 7 and even earlier versions) this code worked.
I did not set the property Series.ColorEachPoint in my code. However - as I explained - it worked in this way before I changed to the new TeeChart version.
Using Series.ColorEachPoint:=true did not have any effect in my case.
Do you have any idea or help?
Thanks,
Andreas
I have transferred a Delphi software project using TeeChart Pro from TeeChart version 7 (and BDS 2006) to TeeChart version 2010 (and RAD-Studio 2010). Now everything worked fine except of one (little?) problem:
The following code fragment should color each point of a LineSeries in a different color, depending on the value of SpecViolationLevel (0..3):
Code: Select all
TLineSeries(Series).ColorEachLine:=False;
Series.SeriesColor:=clBlue;
for j:=0 to Count-1 do
begin
if Data[j].Value.Valid then
begin
case Data[j].SpecViolationLevel of
0: Series.AddXY(Data[j].GetCurrentXValue(j),Data[j].Value.Value,GetXLabel(j),clblue);
1: Series.AddXY(Data[j].GetCurrentXValue(j),Data[j].Value.Value,GetXLabel(j),clYellow);
2: Series.AddXY(Data[j].GetCurrentXValue(j),Data[j].Value.Value,GetXLabel(j),clRed);
3: Series.AddXY(Data[j].GetCurrentXValue(j),Data[j].Value.Value,GetXLabel(j),clPurple);
end;
end;
end;
I did not set the property Series.ColorEachPoint in my code. However - as I explained - it worked in this way before I changed to the new TeeChart version.
Using Series.ColorEachPoint:=true did not have any effect in my case.
Do you have any idea or help?
Thanks,
Andreas