Page 1 of 1

setting the format of the left/right axis labels

Posted: Fri Sep 26, 2008 4:04 pm
by 9232632
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?

Posted: Mon Sep 29, 2008 7:49 am
by narcis
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.

Posted: Mon Sep 29, 2008 12:53 pm
by 9232632
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.

Posted: Wed Oct 01, 2008 8:23 pm
by 9232632
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).

Posted: Thu Oct 02, 2008 7:47 am
by narcis
Hi rperkins,

I'm glad to hear you could solve the problem. Setting Increment to zero means setting it to automatic.

Posted: Wed Oct 08, 2008 10:16 am
by 9239148
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

Posted: Wed Oct 08, 2008 10:40 am
by narcis
Hi Monkey,

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

Thanks in advance.

Posted: Wed Oct 08, 2008 11:05 am
by 9239148
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?

Posted: Wed Oct 08, 2008 11:12 am
by narcis
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.

Posted: Wed Oct 08, 2008 1:35 pm
by 9239148
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.