How to get Maximum and Minimum of a custom axis on zooming ?

TeeChart for ActiveX, COM and ASP
Post Reply
Haianh
Newbie
Newbie
Posts: 11
Joined: Wed Sep 17, 2008 12:00 am

How to get Maximum and Minimum of a custom axis on zooming ?

Post by Haianh » Fri Dec 26, 2008 10:14 am

Dear Steema,

Please give us an advice about how to get Maximum and Minimum of a custom axis.
We have 8 custom axes (vertical) on a graph. And we can set an axis is current active and its max, min value in Vertical Axis Labels of graph.
When performing zoom, we want to get Maximum and Minimum of current custom axis to show on Vertical Axis Labels (It was done successfully with Left Axis).
We use the code like below:
With TeeChart.Axis.Custom(intNo)
lblVertTop.Text = (Math.Round(.Maximum)).ToString()
lblVertMiddle.Text = (Math.Round((.Maximum + .Minimum) / 2)).ToString()
lblVertBottom.Text = (Math.Round(.Minimum)).ToString()
End With
But after zooming, the Maximum and Minimum of Custom Axis (intNo-th) is not changed.
Please give us your feedback about this.

Thanks and best regards

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Dec 29, 2008 10:35 am

Hi Haianh,

you could use similar code to the following :

Code: Select all

Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
TChart1.Axis.Custom(0).SetMinMax TChart1.Axis.Custom(0).CalcPosPoint(X), TChart1.Axis.Custom(0).CalcPosPoint(Y)
TChart1.Header.Text.Item(0) = "minimum " & TChart1.Axis.Custom(0).Minimum & "  maximum " & TChart1.Axis.Custom(0).Maximum
End Sub

Private Sub TChart1_OnUndoZoom()
        TChart1.Axis.Custom(0).Automatic = True
End Sub
It shows how to modify the custom axis labels on zoom and get the min and max values.

Post Reply