Label Format Ignored on AxisY


03-01-2008, 12:20 AM
I have a unbound LineXy graph (using .Points.AddXY), and am using Smart Labels (maybe not as smart as I hoped) = true, to get a scaled value list of the y axis. I set the LabelFormat to {0}% or based on the help file {Value0:P}{Value:P}{0:P}. {0}% is ignored, and the other 2 give an invalid format string error. Is a better way to get a scale on a chart with a %, with the really scale. Adding labels did work correctly (scale wise) on the x axis so my guess it won't work for the Y axis.

Re: Label Format Ignored on AxisY


03-03-2008, 11:27 AM
Thank you for your question. In addition to setting the label format you will also need to set SmartLabels to false, the Axis MajorTick’s step, and LabelsVisible to true.

Ex:
this.chartControl1.Series[0].AxisY.SmartLabels = false;
this.chartControl1.Series[0].AxisY.LabelsVisible = true;
this.chartControl1.Series[0].AxisY.MajorTick.Step = 1;
this.chartControl1.Series[0].AxisY.LabelFormat = "{0:P}";

Thanks,
    Eric

Re: Label Format Ignored on AxisY


03-03-2008, 3:09 PM
Thanks Eric... Great reply.

Re: Label Format Ignored on AxisY


02-16-2009, 8:58 AM
Hi,

I've done this and it works great, but how can I get the MinorTicks to work?
For example if I set them to 0.05d and the visibility on I don't see MinorTicks.

Can you help me?

regards,
Stefan

Re: Label Format Ignored on AxisY


10-26-2011, 4:16 PM
I have my label format correct for #,###,###, but having to turn smartlabels off seems to goob the tick marks marks up by placing tons of them on the axis. If I set the interval at the maxium of 1000, there are still too many tick marks; and there is no way to tell which ones correspond to the numbers....this Axis can be a wide range of numbers (ie: 0-1,000 or 0-1,000,000)
How can I get this to look better?
I am trying to match the look on the web page dundas chart control.
-Thank you
-Time is money they say...I never have enough time!

Re: Label Format Ignored on AxisY


10-27-2011, 3:51 AM
The only way I can think that to work is by setting SmartLabels to true and let it show the labels. However, this would mean that the Label Format will not be visible...

What happens if you use step value of 10,000?
Amit Pal
GrapeCity- DataDynamics

Re: Label Format Ignored on AxisY


10-27-2011, 7:02 AM
Yes, This can be done in code, but the GUI interface limits the step to 1,000. In code I used hte following to make the necessary adjustments for varying ranges.

If dv.Table.Rows.Count > 0 Then
Dim h As Integer = CInt(dv.Table.Rows(dv.Table.Rows.Count - 1).Item("Ftot"))
Select Case h
Case 0 To 100
s = 10
Case 99 To 1000
s = 100
Case 999 To 10000
s = 1000
Case 9999 To 100000
s = 10000
Case 99999 To 1000000
s = 100000
Case Is > 1000000
s = 500000
End Select
End If

For mae the max value here was always hte last record.

It would be nice if the smart label would do this.
A future enhancement perhaps?
-Time is money they say...I never have enough time!

Re: Label Format Ignored on AxisY


10-31-2011, 3:51 AM
Yes, the only way as of now is to set that value in code...

Amit Pal
GrapeCity- DataDynamics