Y Property

Microsoft Office Web Components Visual Basic

expression.y

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

Use the ValueToPoint method to return the coordinates of a data point to a Coordinate object.

Use the x property to return the X coordinate of the data point currently stored in the Coordinate object.

Example

This example changes the title of the first chart in Chartspace1 to the pixel coordinates of a data point in the first series of the chart.

Sub GetPixelCoordinates()

    Dim chChart1
    Dim lXPos
    Dim lYPos
    Dim coPointCoordinates

    ' Set a variable to the first chart in Chartspace1.
    Set chChart1 = ChartSpace1.Charts(0)

    ' Enable the title for the chart.
    chChart1.HasTitle = True

    ' Set a Coordinate object to the coordinates of a data point.
    Set coPointCoordinates = chChart1.SeriesCollection(0).ValueToPoint("Pears", 10)

    ' Set a variable to the X-coordinate.
    lXPos = coPointCoordinates.x

    ' Set a variable to the Y-coordinate.
    lYPos = coPointCoordinates.y

    ' Set the chart's titles to the pixel coordinates of the specified
    ' data point.
    chChart1.Title.Caption = "X(" & lXPos & ") Y(" & lYPos & ")"

End Sub