zero line

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sm
Newbie
Newbie
Posts: 13
Joined: Wed Feb 02, 2005 5:00 am

zero line

Post by sm » Fri Apr 29, 2005 7:54 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 29, 2005 8:24 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

sm
Newbie
Newbie
Posts: 13
Joined: Wed Feb 02, 2005 5:00 am

Post by sm » Fri Apr 29, 2005 8:37 am

Thanks!

Post Reply