Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic XAxis Label (Read 5092 times)
kmck
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 11th, 2014
XAxis Label
Jun 11th, 2014 at 8:58am
Print Post  
Hi,

I have automatic code which get the following datat source : Y data - 4
X data - 1.95

And generate the following numbers for the chart

this.lineChart.XAxisSettings.MinValue = 1.56;
this.lineChart.XAxisSettings.MaxValue = 2.34;
this.lineChart.XAxisSettings.AxisDelta = 0.195;
this.lineChart.XAxisSettings.NumberCustomFormat = "0.#";
this.lineChart.XAxisSettings.NumberFormat = MindFusion.Charting.NumberFormat.Custom;
this.lineChart.XAxisSettings.LabelType = MindFusion.Charting.AxisLabelType.AutoScale;

I got the attached chart
You can see that the 1.95 value look on the chart as 2

I found that this happen when the min value has more digits after the dot then defined NumberCustomFormat

I think this is a bug.
Can you please advice

Attched is the test application I created for that case

Thanks
Kobi
  

MindFusionTests.rar (Attachment deleted)
chart.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: XAxis Label
Reply #1 - Jun 11th, 2014 at 10:22am
Print Post  
Hi,

The actual position is 1.95, but the label is rounded to 2 by Float.ToString("0.#"). Set NumberCustomFormat = "0.##" to see 1.95.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
kmck
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 11th, 2014
Re: XAxis Label
Reply #2 - Jun 12th, 2014 at 6:44am
Print Post  
I would expect that if I round the label the position will be update as well otherwise it may confuse

According to what you say I am not supposed to round the label which will always cuase to this issue
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: XAxis Label
Reply #3 - Jun 12th, 2014 at 7:17am
Print Post  
Automatic labels can be drawn only at regular intervals at this time. You will have to match NumberFormat to AxisDelta's numeric precision to avoid rounding offsets, or set such AxisDelta that will fit the label precision you want to show, i.e. 0.2 instead of 0.195.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint