Page 1 of 1

TeeChart Axis

Posted: Fri Sep 24, 2010 7:20 pm
by 10052635
When I have an axis with negative and positive values the axis text values are correct except for the zero (0) value which is some small number like 3.943E-16. How can I make this display the value (0) instead? See image below (I hope the image comes through.
[img]C:\STI%20Documents\Curve%20Trace\Curves%20for%20website\MOSFET\MOSFET%20Negative%20VGS\example.jpg[/img]

Re: TeeChart Axis

Posted: Mon Sep 27, 2010 11:00 am
by 10050769
Hello Roy,
I have tried to reproduce your problem using next codes, but it works fine:
First test code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
    Series1.AddXY(0,25);
    Series1.AddXY(-1,-35);
    Series1.AddXY(3,15);
    Series1.AddXY(1,-10);
    Series1.AddXY(-2,23);
end;
Second test code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Axes.Left.LabelsExponent:=True;
  Chart1.Axes.Left.AxisValuesFormat:='#.0 "x10" E+0';
  Series1.Add(-10e-20);
  Series1.Add(-10e-15);
  Series1.Add(-10e-10);
  Series1.Add(-10e-5);
  Series1.Add(0);
  Series1.Add(10e-5);
  Series1.Add(10e-10);
  Series1.Add(10e-15);
  Series1.Add(10e-20);
end;
Could you please, tell us which version of TeeChart VCL you can use? On the other hand, Could you try again attach image example.jpg because, I haven't seen this?

Thanks,

Re: TeeChart Axis

Posted: Mon Sep 27, 2010 4:58 pm
by 10052635
The data points are correct. When I click on the series the data has, for example (-.3, -.2, -.1, 0, .1, .2, .3). The chart is initialized at runtime and then the data is added as the program is run one point at a time. The chart initialization includes the axis minimum (e.g. -.3) and the axis maximum (e.g. .3) and then the chart is displayed before the data points start coming in. The chart text for the axis is, for example ( -.3, -.2, -.1, 3.267e-16, .1, .2, .3). and it this text I would like to change so that the zero point actually has "0" for the text.

Re: TeeChart Axis

Posted: Mon Sep 27, 2010 5:21 pm
by 10052635
I tried to include a JPG image of the chart. Is there any way I can send you the JPG?

Re: TeeChart Axis

Posted: Mon Sep 27, 2010 6:24 pm
by 10052635
I believe I now have the picture attached.
Example.jpg
Example.jpg (113.33 KiB) Viewed 6453 times

Re: TeeChart Axis

Posted: Wed Sep 29, 2010 9:39 am
by narcis
Hi Roy,

You can use OnGetAxisLabel or OnGetNextAxisLabel events to customize labels, for example:

Code: Select all

procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
  Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
  if LabelText = '0' then
    LabelText := 'my own label text';
end;
If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here and lets us know the exact TeeChart version you are using.

Thanks in advance.