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#)
 Axis Labels
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Linkam

United Kingdom
1 Posts

Posted - 13 Jun 2011 :  08:23:03  Show Profile  Reply with Quote
I have been using the SetAxisLabelsDecimalPos(n) method to set the number of displayed decimal places on my multi Y Axis chart.
This works well until I do a zoom, which seems to override the setting.

Is there a way to stop this?

Or is there a event fired after a zoom that I can use to update the labels.

quinncurtis

1164 Posts

Posted - 13 Jun 2011 :  09:01:40  Show Profile  Reply with Quote
If you think about it, as you zoom in, the software must override the initial decimal precision, in order that the axes labels continue to reflect the resolution of the current scale, rather than the original scale. To not do so would be an error.

That said, you can just subclass the ChartZoom class, and add your own processing at the end of the zoom operation, overriding the calculated settings.

private class CustomZoom : ChartZoom
        {
            SimpleZoom comp = null;

            public CustomZoom(SimpleZoom component, PhysicalCoordinates transform, bool brescale)
                :
                base(component, transform, brescale)
            {
                comp = component;
            }
            public override void OnMouseUp(MouseEventArgs mouseevent)
            {
                base.OnMouseUp(mouseevent);

                // yAxisLab was made global to the SimpleZoom class,
                 // so it can be accessed here
                comp.yAxisLab.AxisLabelsDecimalPos = 4;

            }
        }



.
.
.
.
// In graph building method

            CustomZoom zoomObj = new CustomZoom(this, pTransform1, true);

			chartVu.SetCurrentMouseListener(zoomObj);

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