Hi Jim,
I'm afraid the only way I can think on is to change how you are adding the points, moving the colors a position to the right. Ie, instead of this:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
Pen.Width:=2;
Add(random*100, 'yellow', clYellow);
Add(random*100, 'red', clRed);
Add(random*100, 'green', clGreen);
Add(random*100, 'blue', clBlue);
Add(random*100, 'gray', clGray);
Add(random*100, 'maroon', clMaroon);
end;
end;
You could do this:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
Pen.Width:=2;
Add(random*100, 'yellow', clTeeColor);
Add(random*100, 'red', clYellow);
Add(random*100, 'green', clRed);
Add(random*100, 'blue', clGreen);
Add(random*100, 'gray', clBlue);
Add(random*100, 'maroon', clGray);
end;
end;
Alternatively, if you can't change the way you add the point colors, you could loop the array of colors to move them. Ie:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
Pen.Width:=2;
Add(random*100, 'yellow', clYellow);
Add(random*100, 'red', clRed);
Add(random*100, 'green', clGreen);
Add(random*100, 'blue', clBlue);
Add(random*100, 'gray', clGray);
Add(random*100, 'maroon', clMaroon);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
with Chart1[0] do
begin
for i:=Count-1 downto 1 do
ValueColor[i]:=ValueColor[i-1];
//ValueColor[0]:=clTeeColor;
end;
end;