HorizontalExtentMax Property

Microsoft Office Web Components Visual Basic

HorizontalExtentMax Property

Use this property to specify or determine the maximum extent of the horizontal view of the ChScrollView object. Returns a Long. Read/write Long.

expression .HorizontalExtentMax

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. The HorizontalExtentMax property represents the total height of a chart whether that chart is zoomed or not. 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 HorizontalExtent and the HorizontalExtentMax properties to toggle a chart view between zoomed and unzoomed (horizontally). In this example, the Chart component is called ChartSpace1.

    Sub ZoomView()
    Dim lngHEM

    lngHEM = Chartspace1.Charts(0).ScrollView.HorizontalExtentMax

    If Chartspace1.Charts(0).ScrollView.HorizontalExtent = lngHEM Then
          ' Zoom the chart.
          Chartspace1.Charts(0).ScrollView.HorizontalExtent = (lngHEM / 3)
    Else
          ' Zoom out on the chart.
          Chartspace1.Charts(0).ScrollView.HorizontalExtent = lngHEM
    End If
End Sub