SharpGraph for .NET Support

Started by andrews at 03-01-2008 12:20 AM. Topic has 7 replies.

Print Search Rate
Sort Posts:    
   03-01-2008, 12:20 AM
andrews is not online. Last active: 7/4/2011 3:43:51 PM andrews

Not Ranked
Joined on 09-23-2003
New Zealand
Posts 15
Label Format Ignored on AxisY
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.
   Report 
   03-03-2008, 11:27 AM
ericc is not online. Last active: 4/4/2009 4:32:14 PM ericc

Top 10 Posts
Joined on 03-01-2005
Posts 1,857

DDStaff
Re: Label Format Ignored on AxisY
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


   Report 
   03-03-2008, 3:09 PM
andrews is not online. Last active: 7/4/2011 3:43:51 PM andrews

Not Ranked
Joined on 09-23-2003
New Zealand
Posts 15
Re: Label Format Ignored on AxisY
Thanks Eric... Great reply.
   Report 
   02-16-2009, 8:58 AM
stefanEDY is not online. Last active: 1/13/2009 5:12:18 PM stefanEDY

Not Ranked
Joined on 01-13-2009
Posts 3
Re: Label Format Ignored on AxisY
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

   Report 
   10-26-2011, 4:16 PM
mgosine56280 is not online. Last active: 6/24/2011 3:10:55 PM mgosine56280

Not Ranked
Joined on 03-26-2009
Greenville, SC
Posts 16
Re: Label Format Ignored on AxisY

Attachment: ARChart.zip
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!
   Report 
   10-27-2011, 3:51 AM
Amit Pal is not online. Last active: 2/7/2012 10:11:10 PM Amit Pal

Top 25 Posts
Joined on 12-11-2008
Posts 855

DDStaff
Re: Label Format Ignored on AxisY
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
   Report 
   10-27-2011, 7:02 AM
mgosine56280 is not online. Last active: 6/24/2011 3:10:55 PM mgosine56280

Not Ranked
Joined on 03-26-2009
Greenville, SC
Posts 16
Re: Label Format Ignored on AxisY
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!
   Report 
   10-31-2011, 3:51 AM
Amit Pal is not online. Last active: 2/7/2012 10:11:10 PM Amit Pal

Top 25 Posts
Joined on 12-11-2008
Posts 855

DDStaff
Re: Label Format Ignored on AxisY
Yes, the only way as of now is to set that value in code...

Amit Pal
GrapeCity- DataDynamics
   Report 
GrapeCity » Product Support » SharpGraph for ... » Label Format Ignored on AxisY

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.