편집

다음을 통해 공유


Series.XValues property (PowerPoint)

Returns or sets an array of x values for a chart series. Read/write Variant.

Syntax

expression.XValues

expression A variable that represents a 'Series' object.

Remarks

You can set the XValues property to a range on a worksheet or to an array of values, but not to a combination of both.

For PivotChart reports, this property is read-only.

Example

Note

Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

The following example sets the values from a range address.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        .Chart.SeriesCollection(1).XValues = "=Sheet1!B1:B5"

    End If

End With

Note

Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

To assign a constant value to each individual data point, you must use an array, as shown in the following example.

With ActiveDocument.InlineShapes(1)
    If .HasChart Then
        .Chart.SeriesCollection(1).XValues = _
            Array(5.0, 6.3, 12.6, 28, 50)
    End If
End With

See also

Series Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.