setting the format of the left/right axis labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
rperkins
Newbie
Newbie
Posts: 58
Joined: Wed May 26, 2004 4:00 am

setting the format of the left/right axis labels

Post by rperkins » Fri Sep 26, 2008 4:04 pm

i have inherited some code that uses a "grouping" form, which has a TChart as one of it's components. i would like to set the format of the left and right axis labels, but everything i've tried so far has failed. i've set the Left and Right Axis AxisValuesFormat settings to "#,##0.###" (in the form designer for the grouping), but the values are always displayed as integer (eg, 165333.333 is displayed as 165333). i've stepped thru the debugger and the format for the chart shows "#,##0.###" (as expected), and the value is a double, as expected. it's passed to series->AddXY correctly.

is there some "master" setting that says to display values as integer?

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

Post by Narcís » Mon Sep 29, 2008 7:49 am

Hi rperkins,

No, using AxisValuesFormat should work fine. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

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

rperkins
Newbie
Newbie
Posts: 58
Joined: Wed May 26, 2004 4:00 am

Post by rperkins » Mon Sep 29, 2008 12:53 pm

i had figured that it was AxisValuesFormat, but, wanted to check. will have to do some more debugging.

this is part of a large application, with some 3rd party components, so, simply posting the code, i think, won't allow you to debug it.

i'm going to create a separate control based on this "grouping" and see what happens. if it still doesn't work, then, it might be in a smaller form that would allow posting.

thanks.

rperkins
Newbie
Newbie
Posts: 58
Joined: Wed May 26, 2004 4:00 am

Post by rperkins » Wed Oct 01, 2008 8:23 pm

after much debugging and frustration, i found that the LeftAxis Increment parameter was set to 1 (Right Axis was also set to 1). changing them to 0, resulted in the labels being displayed as expected (floating point values).

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

Post by Narcís » Thu Oct 02, 2008 7:47 am

Hi rperkins,

I'm glad to hear you could solve the problem. Setting Increment to zero means setting it to automatic.
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

Monkey
Newbie
Newbie
Posts: 12
Joined: Wed Nov 09, 2005 5:00 am

Post by Monkey » Wed Oct 08, 2008 10:16 am

Hi,

I have been having a similar problem. My Chart is displaying values between 0 -> 0.002 . I have set "AxisValuesFormat" to zero, and the "Increment" to 0.001. The axis appears in the middle, but the label is "0" instead of "0.001".

Do I need to set something else?

Best regards,
Monkey

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

Post by Narcís » Wed Oct 08, 2008 10:40 am

Hi Monkey,

Have you tried setting AxisValuesFormat to something similar as what rperkins suggested?

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

Monkey
Newbie
Newbie
Posts: 12
Joined: Wed Nov 09, 2005 5:00 am

Post by Monkey » Wed Oct 08, 2008 11:05 am

I've just tried setting AxisValuesFormat to 0.000 and it appears to work fine now. :)

Can i ask for future reference:

What is the minimum size axis increment?
Is there a maximum number of increments that an axis may display?

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

Post by Narcís » Wed Oct 08, 2008 11:12 am

Hi Monkey,
I've just tried setting AxisValuesFormat to 0.000 and it appears to work fine now.
I'm glad to hear that.
What is the minimum size axis increment?
There's no minimum axis increment.
Is there a maximum number of increments that an axis may display?
No, axis can display as many labels as desired provided they don't overlap.
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

Monkey
Newbie
Newbie
Posts: 12
Joined: Wed Nov 09, 2005 5:00 am

Post by Monkey » Wed Oct 08, 2008 1:35 pm

narcis wrote:No, axis can display as many labels as desired provided they don't overlap.
Thought this might be the case. My increment is set to 0.001 but the chart only displays labels (and grid lines) in increments of 0.002. This is not a problem however.

Thanks again for your valued assistance :)

Monkey.

Post Reply