Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Rounding of limits when an Axis object is drawn?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Tobias J

10 Posts

Posted - 19 Sep 2006 :  09:00:34  Show Profile  Reply with Quote
Hello

I’ve encountered a drawing error which I would appreciate some help with solving. I have reproduced the error using a SimpleLineMarkerPlot created from a SimpleDataset consisting of datapoints at x = 0, 1, 2, …., 15. The x-axis limits are set to [0, 10].

The error occurs when scrolling (and zooming as well) is made in the chart. The data in the SimpleLineMarkerPlot is moved visually, the coordinate system is updated, and everything concerning the x-axis is reported to be correct. However, the x-axis limits that are actually drawn are not the same as the ones reported by xAxis.GetAxisMin() and xAxis.GetAxisMax(). The x-axis is still showing limits [0, 10], while GetAxisMin/Max returns the limits [0.091 10.091]. Not until scrolling past xAxis.GetAxisMin() = 0.545 is made, the x-axis changes its limits visually. The new visual limits are [1, 11] though, instead of [0,545, 10,545] which is returned by the GetAxisMin/Max methods.

Are the the x-axis limits rounded when the x-axis is actually drawn? If so, how can I work around it?

Regards,
Tobias

Edited by - Tobias J on 19 Sep 2006 09:02:12

quinncurtis

1164 Posts

Posted - 19 Sep 2006 :  09:19:07  Show Profile  Reply with Quote
The axes and tick marks will be drawn using the values defined by the axis range (xAxis.AxisMin to xAxis.AxisMax). What you are probably seeing is that the value displayed by the axis labels will be rounded to the nearest value based on the xAxisLabels.AxisLabelsDecimalPos property, which in your case is 0. Increase the xAxisLabels.AxisLabelsDecimalPos to 3 and you will probably see the precision you describe. Looking at the range of your data values, x=0,1,2,...15, it would be a visually better graph is you stuck with a AxisLabelsDecimalPos value of 0, and just scale the underlying coordinate system using increments of 1,2,3, etc. and not allow such minute changes in the axis scale. This would force the major tick marks to fall on even intervals, and you would not have to use as many digits to the right of the decimal to label the tick marks accurately.

Go to Top of Page

Tobias J

10 Posts

Posted - 19 Sep 2006 :  10:48:15  Show Profile  Reply with Quote
quote:
Originally posted by quinncurtis

... What you are probably seeing is that the value displayed by the axis labels will be rounded to the nearest value based on the xAxisLabels.AxisLabelsDecimalPos property, which in your case is 0...



That was indeed the case. Thanks for the help and for the quick reply!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07