Jump to content
Software FX Community

Zoom problem


User (Legacy)

Recommended Posts

Scenario:

I have a chart where X points represents some DateTimes so related points

are marked with DataType.XValue.

Everything runs fine and i can see my graph properly rendered.

I want to zoom my Graph (I use Zoom method) and when user releases the mouse

after area selection i want to change X Scale's Step and MinorStep so that

even on a Zoomed area i can have the same number of Major and Minor Steps.

In MouseUp event i have this code:

if(chart.Zoom) UpdateX();

Where UpdateX() contains:

{

double ViewMin,ViewMax;

//Get Min/Max values displayes

chart.AxisX.GetScrollView(out ViewMin,out ViewMax);

min=DateTime.FromOADate(ViewMin);

max=DateTime.FromOADate(ViewMax);

}

The problem is that when UpdateX() is invoked from MouseUP, ViewMin and

ViewMax have certain values, if using a button i reinvoke the same routine

(chart has redrawn) ViewMax as a slightly different value and this causes me

calculation error.

It looks like GetScrollView is not properly updated after user has selected

an area (on Zoom mode) and then releases the mouse.

Tried calling UpdateSizeNow() before using GetScrollView but nothing

changes.

What I'd like to have is to get Min and Max values after users zoomed an

area so that i can recalculate Step and MinorStep, any hint?

Regards

--

Corrado Cavalli [Microsoft .NET MVP-MCP]

UGIdotNET - http://www.ugidotnet.org

Weblog: http://www.ugidotnet.org/710.blog

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...