次の方法で共有


SeriesCollection Object (Word)

Represents a collection of all the Series objects in the specified chart or chart group.

Version Information

Version Added: Word 2007

Remarks

Use the SeriesCollection method to return the SeriesCollection collection.

Example

Use the Extend method to extend an existing series. The following example adds the data in cells C6:C10 in the chart's worksheet to an existing series in the series collection of the chart.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.SeriesCollection.Extend "='Sheet1'!$C$6:$C$10" 
 End If 
End With

Use the Add method to create a new series and add it to the chart. The following example adds the data from cells D1:D5 in the chart's worksheet as a new series to the chart.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.SeriesCollection.Add "='Sheet1'!$D$1:$D$5" 
 End If 
End With

Use SeriesCollection(Index), where Index is the series index number or name, to return a single Series object. The following example sets the color of the interior for the first series in embedded chart one on Sheet1.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.SeriesCollection(1).Interior.Color = RGB(255, 0, 0) 
 End If 
End With

See Also

Concepts

SeriesCollection Object Members

Word Object Model Reference