Page 1 of 1

Zoomed property is True after unzoom

Posted: Tue Mar 17, 2009 1:31 pm
by 10051902
Hi,

After I call UndoZoom, the Zoomed property is still True in OnUndoZoom. Is this normal ?

The call to UndoZoom is done from a menu action.

I then have code in OnUndoZoom and OnZoom where I check for Zoomed to display data in another part of the software.

Posted: Tue Mar 17, 2009 2:28 pm
by yeray
Hi strobbekoen,

We think that this is working as expected: the zoomed property is actualized once finished the OnUndoZoom method.

We are not sure of what are you trying to do here but note that you could find the "actual value" at OnAfterDraw event.

If this doesn't help you, please, try to explain what are you exactly trying to do, and we'll try to give you the correct direction to follow.

Posted: Tue Mar 17, 2009 2:46 pm
by 10051902
Hi,

Thanks for the reply. I will explain what I am trying to do.

I am writing a software application for sports. For example, I display a cyclist's training in the chart. My left axis is divided into 5 custom axis for power, heartrate, speed, cadence etc.. My right axis is a custom axis for altitude. Bottom axis is the time (duration of the training) or distance.

The chart is linked to a google map with the GPS track. When i move the cursor in the chart, it moves in the GPS track and vice versa. I want to do the same thing for zooming.

Whenever I zoom/unzoom the chart, I do the same thing in the embedded google map. So I check the zoomed property in the events to update it. It's odd that the zoomed property in OnUndoZoom is True while at the same time the bottom axis has already been unzoomed (min/max are full track at this point).

Also, is there a way for the min/max properties of the vertical custom axises to update when I zoom in/out ? I have them all set at automatic but they don't change when I zoom in.

Here is a screenshot so you will see what it does:

Image

Posted: Tue Mar 17, 2009 3:55 pm
by yeray
Hi strobbekoen,

1. Zoomed property.

I'm still not sure to understand the exact problem you are suffering. I suppose that you are checking the property before zooming, once zoomed and after unzoomed. If you are checking the property just at the beginning of UndoZoom, you could try to call Chart1.Draw to update everything before checking the variable. Otherwise, I can't see what conflict are you suffering.


2. SetMinMax method.

Maybe the two issues are related, but here you can find a starting example of how you could zoom with custom axis.


Congrats, your application looks really nice! 8)

Posted: Tue Mar 17, 2009 4:50 pm
by 10051902
Hi,

I decided to use a FZoomed local property to track the state of zoomed in OnZoom and OnUndoZoom. During my refresh methods I then just use FZoomed. Works since the bottom axis is already updated in the zoom events.

For the vertical axis, I opted to calculate them since I have 6 of them. I'd only have to run through the points once and track all the min/max's.

Thanks for your help and the nice comment!

Koen