Page 1 of 1

Line Chart, a way to have to Zero line on the Y-axis in <

Posted: Fri May 27, 2005 8:04 am
by 9339206
Is there a way, in a line-chart with chart-lines-values going between -50 and +50 to have the 0 (zero) line a bit ticker.
Now there are several line on the Y axis (wich is good) but the zero line should (in my case) be easy to see.

Thx

Posted: Fri May 27, 2005 8:43 am
by narcis
Hi HLEBOEUF,

Yes, you could do implement how do you want to display the zero label at the GetAxisLabel event doing something like:

Code: Select all

procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
  Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
var
  SpecialLabel: String;
begin
  SpecialLabel:='0';
  if ((StrComp(PChar(LabelText),PChar(SpecialLabel))=0) and
      (Sender=Series1.GetVertAxis)) then
    With Sender.LabelsFont do
    begin
      Style:=[fsBold];
      Size:=10;
      Color:=clRed;
    end
  else
    With Sender.LabelsFont do
    begin
      Style:=[fsItalic];
      Size:=8;
      Color:=clBlack;
    end;
end;
You could also use Custom Labels or a Color Line Tool. For more information on those options please have a look at the TeeChart features demo, available at the TeeChart program group and search for those terms.