Figure Illustrating the Add method the data

A

E

C

1

Average Std

Dev.

2

A

1.23

2

3

B

1

4

4

C

4 6

3

5

D

4 43

4.5&

S

E

4>34

G

7

F

3

4

The following code will create the chart in Figure 21-26:

Dim co As ChartObject

Set co = ActiveSheet.ChartObjects.

Add(100, 100, 300, 200) co.Chart.ChartType = xlColumnClustered co.Chart.SeriesCollection.Add

Source:=ActiveSheet.Range("Al:C7"), Rowcol:=xlColumns, SeriesLabels:=True, Categorylabels:=True

Note that the series labels are in the first row and the category labels are in the first column.

Figure 21-26. Illustrating the Add method: the chart

Figure 21-26. Illustrating the Add method: the chart

0 0

Post a comment