Page 1 of 1

zero line

Posted: Fri Apr 29, 2005 7:54 am
by 9340851
Is it possible to enable just a zero line for bottom axis and disable all other grid lines?

Imagine a chart with two horizontal bar series, stacked. One series has only negativ values (evolves to the left) and the other evolves to the right.

I only need one grid line at X axis value 0.

Posted: Fri Apr 29, 2005 8:24 am
by narcis
Hi sm,

Yes, this is possible. I'd use a TColorLineTool as in the code below.

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.Add(-5);
  Series1.Add(5);
  Series2.Add(-3);
  Series2.Add(8);

  Chart1.BottomAxis.Grid.Visible:=false;

  With ChartTool1 do
  begin
    Style:=clCustom;
    Value:=0;
    Draw3D:=false;
    Pen.Style:=psDot;
    AllowDrag:=false;
    DrawBehind:=true;
  end;
end;

Posted: Fri Apr 29, 2005 8:37 am
by 9340851
Thanks!