Share via


VerticalExtent Property

You use the VerticalExtent property to specify or determine the extent of the vertical view of the ChScrollView object. Returns a Long. Read/write Long.

expression**.VerticalExtent**

*expression   * Required. An expression that returns a ChScrollView object.

Remarks

You use methods and properties of the ChScrollView object to retrieve information about and control the view of a chart. The portion of the Chart component that displays the chart itself is the visible plot area and it can display the entire chart or a portion of the chart. When only a portion of the chart is displayed in the visible plot area, the effect is as if you have zoomed in on that portion of the chart and the remainder of the chart is contained within a virtual plot area that extends beyond the boundary of the visible plot area. For information on how the values of the properties of the ChScrollView object relate to each other, see the ChScrollView object topic.

Example

The following example uses the VerticalExtentMax property to toggle a chart view between a zoomed and unzoomed.

Sub ToggleZoom()
     If objChart.ChScrollView.VerticalExtent = objChart.ChScrollView.VerticalExtentMax Then
          ' Zoom chart and make it scrollable.
          objChart.ChScrollView.VerticalExtent = (objChart.ChScrollView.VerticalExtentMax / 2)
          objChart.ChScrollView.HorizontalExtent = (objChart.ChScrollView.HorizontalExtentMax / 2)
     Else
          ' Unzoom chart and remove scrolling.
          objChart.ChScrollView.VerticalExtent = objChart.ChScrollView.VerticalExtentMax
          objChart.ChScrollView.HorizontalExtent = objChart.ChScrollView.HorizontalExtentMax
     End If
End Sub

Applies to | ChScrollView Object