Series charts

The purpose of a series chart is to compare changes in some variable over time perhaps. The most widely used series charts are line charts and area charts. As the name suggests line charts display simple lines to depict changes, whereas, area charts displays areas filled below the lines. In all series charts, the horizontal line is called the x-axis and the vertical line is called the y-axis. Often x is known as the independent variable and y the dependent variable, i.e. y depends on x.

Suppose that we were interested in viewing the trend in the total sales for each week during the previous month in the weeklysales worksheet. We could create a series chart - called a line chart - as shown in Figure 2.17. The title of the chart is 'Total Weekly Sales for Month', and the total sales are plotted against the week number. We can record the macro for this task by the following steps:

1 Open the workbook called SALESMAN.XLS.

2 Select the worksheet weeklysales.

3 Choose Tools > Macro > Record New Macro. You will see the Macro dialog box appear - enter the name 'lineChart'.

4 Select the range of cells from C41 to F41.

5 Click the Chart Wizard button on the Formatting toolbar - you will see the dialog box (Figure 2.13), select the Line chart type and click the Next button.

Figure2.13 Chart type selection

6 The dialog box shown in Figure 2.14 will appear. Make sure that Rows is selected and click the Next button.

7 The Chart Options dialog box will appear. You will need to enter the Chart Title as well as the Category (X) axis and the Y value name for the chart (see Figure 2.15). When done, click the Next button.

8 At the Chart Location dialog box (see Figure 2.16), make sure that the AsObject option is selected and click the Finish button.

9 You will now see the chart appear in the worksheet (see Figure 2.17).

10 Click the Stop recording macro button.

Figure 2.14 Select chart source data

Chart Wizard - Step 3 of 4 - Chart Options

Figure 2.14 Select chart source data

Chart Wizard - Step 3 of 4 - Chart Options

Axes ] Gridlines j Legend ] Data Labels j Data Table |

j Total Weekly Sales for Month

jweek Number Value (Y) axis: I Total Sales Second category (X) '¿ids;

Total Veeklg Sales for Month

M 600

"S 500 1 400 o 300 H £00 100 0

A ^

1 * - JiM 1

—S^-

1 Z 3 i v«k :J.-t><i

Cancel |

Chart Wizard - Step 4 of 4 - Chart Location

Place chart:

Figure2.15 Select chart options

Figure 2.16 The Chart Location dialog box

Cancel |

Chart Wizard - Step 4 of 4 - Chart Location

Place chart:

Figure2.15 Select chart options

Figure 2.17 The chart embedded in its sheet

0 0

Post a comment