TeeChart Axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

TeeChart Axis

Post by Roy » Fri Sep 24, 2010 7:20 pm

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]

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart Axis

Post by Sandra » Mon Sep 27, 2010 11:00 am

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,
Best Regards,
Sandra Pazos / 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

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

Re: TeeChart Axis

Post by Roy » Mon Sep 27, 2010 4:58 pm

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.

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

Re: TeeChart Axis

Post by Roy » Mon Sep 27, 2010 5:21 pm

I tried to include a JPG image of the chart. Is there any way I can send you the JPG?

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

Re: TeeChart Axis

Post by Roy » Mon Sep 27, 2010 6:24 pm

I believe I now have the picture attached.
Example.jpg
Example.jpg (113.33 KiB) Viewed 6454 times

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

Re: TeeChart Axis

Post by Narcís » Wed Sep 29, 2010 9:39 am

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.
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

Post Reply