I have a LS where the points are different colors. The line between two points is currently the color of the point to the right. Is there a way to make the line color to be the color of the *left* point?
(Why: the point colors represent a financial state at the beginning of a year and that state continues until the next year. So using the state color of the next year (the right point) makes no sense.)
Thanks.
Line series - line colors
Re: Line series - line colors
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:
You could do this:
Alternatively, if you can't change the way you add the point colors, you could loop the array of colors to move them. Ie:
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;
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;
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;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |