HorizontalPosition Property

Microsoft Office Web Components Visual Basic

HorizontalPosition Property

You use the HorizontalPosition property to specify or determine the current horizontal view position of the ChScrollView object. Returns a Long. Read/write Long.

expression .HorizontalPosition

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.

The HorizontalPosition property provides information about the horizontal position of a chart. The extreme left of the viewable area of the Chart component is 0 and the extreme right of the viewable area is where the value of the HorizontalPosition property equals the value of the HorizontalExtentMax property (although you can set the the HorizontalPosition property to values greater than the value of the HorizontalExtentMax property or even to negative values). As long as the value of the HorizontalExtent property is greater than the value of the HorizontalExtentMax property, the entire chart will be visible.

When the HorizontalPosition property equals zero, the extreme left of the plot area will be at the extreme left of the scroll view window. When the HorizontalPosition equals HorizontalExtentMax, the plot area is pushed to the left so that right of the plot area is visible at the left of the scroll view window. The HorizontalPosition property can be a negative number. For example if HorizontalPosition = (-0.25 * HorizontalExtentMax) then the plot area will be pushed to the right by 25% of the virtual width of the plot area.

Example

The following example changes the horizontal and vertical positions of the scroll view of the Chart component (called ChartSpace1 in this example).

    Dim lngHorizontal
Dim lngVertical

lngHorizontal = ChartSpace1.Charts(0)ScrollView.HorizontalPosition
lngVertical = ChartSpace1.Charts(0)ScrollView.VerticalPosition

ChartSpace1.Charts(0)ScrollView.SetPosition lngHorizontal + 300, lngVertical + 200