Beruflich Dokumente
Kultur Dokumente
Components of a Chart 1 Chart types 2 Data tables 4 The Chart Wizard 5 Column Charts 7 Line charts 8 XY(Scatter Charts) 9 Line and XY Charts Compared 9 Modifying a Chart 10 Combination Chart 12 Stepped Graph 13 Adding a new series 13 Semi-log charts 15 Gantt charts 17 Other topics 18
Components of a Chart
Before we see how to make charts in Excel, it will be useful to know the correct terminology for the parts of a chart. This will help you understand the various dialog boxes used to make or modify a chart, and to follow instructions in the Help facility. The left hand chart in Figure 1 shows that areas have a fill and a border. You may specify the colours for each of these separately. I am not recommending the colours used here! They were selected to make it easy to identify various areas. The areas are:
100 90 80 70 60 50 40 30 20 10 0
Figure 1 Chart area: The entire chart shown with a blue fill and dark blue border. All borders may be formatted to change their weight (thickness) and style (solid or dotted lines). The area used for charting the data - white with red border. Had the plot area been formatted with fill set to none, it would have the same colour as the chart area. The two axes override the colour of the border at the bottom and left side.
Plot area:
Creating Charts in Microsoft Excel 2 Legend: Columns: Small box with text - yellow with purple border. The legend identifies the various data series. A chart with one data series does not need a legend. The columns for the different data series are generally shown with different colours. It is also possible to separately colour the columns for a single data series.
In addition to simple colours, areas may be given a colour gradient and/or a pattern such as herringbone or brickwork. The chart on the right in Figure 1 identifies these components: X-category-axis: The horizontal axis shown in blue. The font was also formatted blue for this axis. The small lines at right angles to the axis are tick marks. Y-axis: The axis to the left (red) is the y-axis. The values on the axis range from 0 to 100; these can be changed. There are tick marks every 10 units; we could change this to some other value. Secondary axis: The chart is shown with a secondary y-axis in green. A secondaryaxis is useful when two data series have very different ranges of values. It is inappropriate in the current case. When a chart has a secondary y-axis, it is possible also to have a secondary x-axis. Lines, markers: The two data series in the chart are displayed with lines and markers. We can chose (i) lines only, (ii) markers only, (iii) lines and markers, and (iv) no lines, no markers - the data series is invisible! The lines and the markers for one data series are generally given the same colour but they can be made different. The shape of the markers may also be changed; the colours for the foreground (border) and the background (fill) may be changed independently. In Figure 5.18 of Quantitative Approaches in Business Studies, a jagged line is used to indicate that a chart has y-axis that begins at a non-zero value. Unfortunately, it is not possible to do this in Excel.
Chart types
Four of the basic chart types supported by Excel are shown in Figure 2 while Figure 3 shows some enhancements to these four types. The chart titles show the names used by Excel for these types. Note that Excel uses the term column chart for what most of us call a bar chart and bar chart for a horizontal bar chart. The line and XY(scatter) charts appear to be almost the same but there are important differences, as we will see later. For now, look at the year axes in the two charts and compare the positions of the tick marks (the scale dividers on the axis) with the markers (the solid squares on the lines.) With a line chart the markers are located between tick marks; with an XY chart they are directly above the tick marks on the axis. We can format a Line chart to align the tick marks and markers. The bar chart has been turned into a pictogram, and the titles and axes have been given a blue font. In the column chart, a blue fill has been given to the chart area, and the gap between columns has been reduced thereby widening the columns. Data labels have been
Creating Charts in Microsoft Excel 3 added. The line chart has been converted into an area chart with drop down lines and a data table has been added. The chart title was moved in the XY chart and large open circles replace the squares used for the markers.
A Bar Chart
1999 1998 1997 1996 0 50 100
Profit (000s)
A Column Chart
180 160 140 120 100 80 60 40 20 0 1996 1997 Year 1998 1999
150
200
Profit (000s)
Year
A Line Chart
180 160 140 120 100 80 60 40 20 0 1996 1997
Year
An XY Chart
180 160 140 120 100 80 60 40 20 0 1996
Profit (000s)
1998
1999
Profit (000s)
1997
Year
1998
1999
Figure 2
Year
A Bar Chart
180 160 140 120 100 80 60 40 20 0
A Column Chart
165 140 120 80
1999 1998 1997 1996 0 50 100 Profit (000s) 150 200 Profit (000s)
1996
1999
An Area Chart
200
Profit (000s)
An XY Chart
Profit (000s)
150 100 50 0
Profit
1996 80
1997 120
1998 140
1999 165
0 1996
1997
Year
1998
1999
Figure 3
Creating Charts in Microsoft Excel 4 Figure 4 shows some examples of pie charts. The data for a pie chart may be displayed as the values or as percentages. We may display the category values (truck, car, etc) either next to their slices or in a legend The chart may be exploded or you may explode only those slices you wish to emphasise. The third chart (left on second row) is a 3D chart. Excel allows you to make bar, column and pie charts three dimensional. Before you use a 3D chart, ask yourself if the 3D effect adds anything or does it hide information. The original purpose of a pie chart was to have slices whose areas were proportional to their values. Does the 3D chart preserve this feature? The fourth chart is called a doughnut chart by Excel. The doughnut chart is not limited to just one data series as is the pie chart.
buses 11%
other 4%
trucks 19%
300
100
800
100
buses 11% other 4% trucks 19%
300
bicycles 30%
cars 36%
800
Figure 4
Data tables
Data to be charted may be entered as columns or as rows as shown in Figure 5. If we were planning to make a bar, column or line chart from this data the values 1992, 1993, 1994 would be referred to as the category data. The other three sets of data with headings Hailguard, Rainguard and Total are called data series. However, Excel expects category data to be text data such as Monday, Tuesday, etc. We need to prevent Excel from treating the year values as numbers. The simplest way to do this is to enter them as text. Rather than typing 1992, type 1992. The single quote (apostrophe) will cause the entry to be treated as text but the symbol will not be displayed in the cell.
Figure 5
Figure 6 Select the range A3:B6 with the mouse and click the Chart Wizard icon. In Step 1 of the Chart Wizard process we select the type of chart we require. On the right side of the Step 1 dialog box (see Figure 7), click on the pie chart and on the left side click on the top sketch to select that sub-type. Experiment with the Press and Hold bar to preview your chart. Click the Next button to move to the next step. In Step 2 (Figure 8) we can see that Excel has correctly decided that our data is in a column form. There is seldom any reason to change anything in Step 2 although occasionally options on the Series tab can be useful. Clicking the Next button will move you to Step 3.
Figure 7 Figure 8 In Step 3 (Figure 9) we will have Excel display the data label and the percentage values on the chart. It is interesting to note that Excel does not provide an option to display labels and actual values so we cannot readily make a chart the same as Figure 5.2 of Quantitative Approaches in Business Studies. You may wish to explore the other tabs on the dialog box before clicking the Next button. In Step 4 (Figure 10) we have two choices for the location of our chart: on a separate chartsheet or on the same worksheet as the data. When you have a complex worksheet it may be convenient to place the chart on its own sheet. Having it on the worksheet has the advantage of being able to see how the chart changes when the data is altered. We will select this option before clicking the Finish button.
Figure 10
Figure 9 You may be a little disappointed with the chart you have just made. Later we see a number of ways of modifying a chart but here are three quick things to do. Click just inside the border of the chart to get eight fill handles (small black squares). Drag the chart to the
Creating Charts in Microsoft Excel 7 position you want it. Move the cursor over one of the fill handles - the cursor changes shape to a two-headed arrow (6). Click and drag the mouse to resize the chart; Excel will keep the pie as a circle. Finally, right click on any of the words in the chart to cause a popup menu to appear. Use the Format Data Labels item on the menu and on the Font tab select a more appropriate size for the font. The chart is now complete. You may wish to save the workbook. Later we will change the chart to resemble the lower one in Figure 6.
Column Charts
We will make the column charts displayed as Figures 5.3 to 5.6 in Quantitative Approaches in Business Studies. The Excel results are shown in Figure 11. The data in the worksheet was extracted from Table 5.3 of the book. As we start to make the simple column chart, it becomes obvious that there is a small problem. We need to select the Years and the Totals columns but they are not side-by-side. There is a trick to selecting non-contiguous data. Select A3:A6 in the normal way and then hold down the C key while dragging the cursor over D3:D6. With the data selected, click the Chart Wizard. In Step 1 specify a column chart using the top right hand sub-type (clustered column). Move on to Step 2 where there is nothing to do and then to Step 3. On the Titles tab enter Years for the x-category title and Profit (000s) for the y-axis title. Move to Step 4 and set the location as the worksheet. Your chart should resemble the first one in Figure 11. Later we will modify it to look like the second chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 A B C Pretax profit for year 1992 - 1994 Year 1992 1993 1994 Hailguard Rainguard 70 19 82 46 93 68 D E
180 160 140 120 100 80 60 40 20 0 1992 1993 Year 1994
W eatherguard Profits
200 161
Profit (000s)
Profit (000s)
128
1993 Year
1994
Rainguard Hailguard
100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Rainguard Hailguard
1992
1993 Year
1994
Figure 11
Creating Charts in Microsoft Excel 8 The next three charts have two data series the Hailguard and the Rainguard data. To make a chart similar to the first one in the bottom row of the figure, select A3:C6 and start the Chart Wizard. In Step 1 select Column as the type and the second sub-type (stacked column). Continue to Step 3 where the titles may be added. The other charts may be made in the same way, selecting the appropriate sub-types. There is a quick way to make the second two charts. Select the first column chart with the two data series and perform a Copy & Paste operation. Right click the new chart and open the Chart Type menu item. A dialog box identical to Step 1 of the Chart Wizard opens up. Select the required sub-type and click the OK button.
Line charts
By following the steps above and replacing Line chart for Column chart in Step 1 of the Chart Wizard you may quickly make line charts with the same data, as shown in Figure 12 below. When selecting the sub-type you must decide if you want just a line, just markers, or both. You also decide if you want a trend chart, a stacked chart or a percentage chart. Just click on the Press & Hold button to check if you have opted for the right sub-type.
Line Chart
100 90 80 70 60 50 40 30 20 10 0 1992 1993 Year 180 160 140 Profit (000s) 120 100 80 60 40 20 0 1994 1992 1993 Year 1994 Rainguard Hailguard
Percent of profit
Profit (000s)
Rainguard Hailguard
Hailguard Rainguard
1992
1993 Year
1994
Figure 12
XY(Scatter Charts)
XY or Scatter charts are the types of charts you plotted in algebra class. Each data point has two values an x-value and a y-value which determine the position of the point on the chart. Actually, we may now speak of a graph if we so wished. When the increments between successive x-values are constant, a line chart and an XY chart will be very similar. When the increments vary, a line chart would be totally inappropriate. In an XY chart we have x-values, in all other charts we have x category labels. The reader should have no problem making the left hand XY chart from the data shown in Figure 13 using the same steps as before but selecting this time an XY chart in Step 1 of the Chart Wizard. We will shortly see how to modify the chart to appear like the second one in the figure.
F
120 Sales revenue 110 100 90 80 70
Sales revenue
5.00
10.00
15.00
10
12
Advertising expenditure
Advertising expenditure
Figure 13
XY chart
1200 1000 800 600 400 200 0
80 120 160 200 240 Advertising 280
230
300
Figure 14
Modifying a Chart
We will now see how we can modify, or format, the various components in a chart. At the top of Figure 11 there are two similar charts. We wish to enhance the first to give the second. Right click on the chart area (i.e. just inside the outer border) to display a popup menu as shown in Figure 15 and select the Chart Options item to bring up the Chart Options dialog box. This is very similar to Step 3 of the Chart Wizard. Open the Titles tab (Figure 16) and add Weatherguard Profits as the chart title. By the way, the Excel Spell
Creating Charts in Microsoft Excel 10 Check feature checks text in charts as well as in worksheet cells.
Figure 16
Figure 15
If you look at the menu shown in Figure 15 you will see an item called Chart Type. You can use this to open a dialog box that resembles Step 1 of the Chart Wizard and hence change the chart type should you wish to do so. The first item in the menu is Format Chart Area. This is because we right clicked within the chart area. You could use this item to change the colours of the chart area fill and border. Experiment with this, ending with a simple column chart. The next task is to change the appearance of the columns. Right click on any one of the columns to display a popup menu which is an abbreviated version of that shown in Figure 15. The first item is Format Data Series. Click on this and open the Patterns tab (Figure 17). Select a new colour for the column fill and for the border if you wish. Open the Options tab (Figure 18) and decrease the gap to 50. Note there is no tool for widening the column but changing the gap automatically changes the columns width. The overlap setting has meaning only when there are two or more data series. Compare the two charts in Figure 13; the right hand one has (i) no fill in the plot area, (ii) values on the two axes that display no decimal places, and (iii) a y-axis scale that starts at 70. The first change is readily made by right clicking the plot area, selecting Format Plot Area, and on the Pattern tab clicking in the None radio button in the Area region. The two axes display values with two decimals because this is the format of the source data. When you right click on the x-axis and open the Format Axis dialog box you find a Number tab which in all respects is the same as the dialog used to format a cell. Specify 0 decimals. Repeat this for the y-axis. With the Format Axis dialog box open for the y-axis, open the Scale. This is where you can specify the minimum and maximum values for the axis we need 70 and 100. You will also see that you can set the major units to some other value in this dialog. Experiment with this and other features of the dialog, observing the effect on the chart.
Figure 17
Figure 18
If you select a legend by clicking on it, it may be dragged to any position. Similarly, the text on a pie chart may be repositioned and in this manner make the first chart in Figure 6 resemble the second. However, you must click twice not a double click but two independent clicks. The first selects all the text (at this stage you may format all the text at once), the second selects just one label which may now be dragged to a new position. It takes a little practice, so be patient.
Combination Chart
A combination chart has a mixture of chart types. The chart in Figure 5.15 of Quantitative Approaches in Business Studies has one data series displayed as columns and another as a line. We can create charts like this in Excel as shown by the second chart in the figure below. We begin by making a column chart the first chart in Figure 19. The last entry in the Age column is clearly text, so Excel does not treat this column as a data series. Right click on one of the bars of the Cumulative data columns in the chart and select the Chart Type menu item. In the resulting dialog box, specify Line type. If you have difficulty selecting the data series, temporarily change one of its values for example, change C8's value to 50 to enlarge one of the columns to facilitate its selection. Right click again on the Cumulative data, select the Format Data Series item and on the Axis tab specify Secondary Y Axis. Other formatting may now be done: format the secondary axis to show 0 decimals; add a secondary axis title (right click anywhere on chart, open Chart Options item, open Titles tab); format the fonts to a smaller size (Excel 97 and 2000 seem to make the text too large for most uses), etc.
35 30 Frequency 25 20
Frequency Cumulative %
Figure 19
Stepped Graph
To construct the stepped graph shown on page 92 of Quantitative Approaches in Business Studies, begin by setting up a worksheet similar to Figure 20. Note that the date is repeated when the interest rate changes. Construct an XY(Scatter) chart. Format the yaxis to start at 10% and the x-axis to display the required date format. Click on the fourth data point and then click once more, now right click. The first menu item should be Format Data Point not Format Data Series. Open the Format menu and set No Marker for this point. Repeat the process for the fifth data point and set the Line Style to a dotted line. Point four (with no marker) should now be joined with a dotted line to the marker of point five. Do the same with the ninth and tenth point, respectively.
Interest (%) 17% 16% 15% 14% 13% 12% 11% 10%
25-Jun
1-Jul
31-Jul
28-Nov
29-Sep
Figure 20
28-Dec
26-May
29-Oct
30-Aug
27-Jan
27-Mar
26-Feb
26-Apr
25-Jul
I
Monthly Attendence
=AVERAGE(B2:B13)
=C2
Figure 21
Figure 22 This technique may be used to produce control charts as discussed in Chapter 12 of Quantitative Approaches in Business Studies. Figure 23 shows an example of this. The inset Figure 24 shows the formulas used in the worksheet.
UCL = 355.6
353
355.6 355.6
Average = 349.3
343.4 343.4
348
LCL = 343.4
343 0 5 10 15 20 25
Figure 23
1 2 3 4 5 6 7 8 9 10 11
D ="Average = "&E2 =A2 =A26 ="UCL = "&E6 =A2 =A26 ="LCL = "&E10 =A2 =A26
E =ROUND(AVERAGE(B2:B26),1) =E2
355.6 =E6
343.4 =E10
Figure 24 To make the chart begin by making an XY chart with the data in columns A and B. Format it as required including the scale of the axis. Select D2:E3 and use the Copy tool. Click on the chart to activate it. Use Edit|Paste Special and in the dialog box select the items New Series and Category (X values) in First Column. With the chart still selected, type an equal sign, point and click on cell D1, and click the green check mark in the Formula Bar. This will add the text box Average = 349.3. You may need to drag one side to make it long enough to display all the text. To do this, it may be necessary to first make the text box higher so as to display the centre fill handle that you must drag to elongate the box. Of course, you can decrease the height after the elongation. Repeat this process for the other two lines and labels. You may find that, using the mouse, it is difficult to select text boxes later to move or format them. Selection is easier if you use, instead, the navigation keys t, b, l, and r. By using the up and down keys t, b alternatively with the left and right keys l, r, you will be able to select any object on the chart it may take patience! Once it is selected (its fill handles will be showing), use the command Format|Selected Object.
Semi-log charts
Semi-log charts, introduced in Chapter 17 of Quantitative Approaches in Business Studies, are readily made in Excel. In Figure 25 the data has been plotted as an XY chart left hand side. By formatting the y-axis and specifying Logarithmic scale (see Figure 26) the right hand chart may be made.
1996 2700 92
4000 3500 3000 Turnover (000s) 2500 2000 1500 1000 500 0 1994
10000
Meaglithic
Turnover (000s) 1000
Meaglithic
100
Minimal
Minimal
1995 1996 1997 Year 1998 1999 2000 10 1994 1995 1996 1997 Year 1998 1999 2000
Figure 25
Gridlines have been added to the chart (right click the chart, open the Chart Options item in the pop up menu). These have been formatted to display with grey lines (actually 50% gray) to make them less obtrusive. The text boxes were formatted to have a white fill. Figure 26 shows the dialog box for this a yellow fill is shown for the sake of clarity.
Figure 26
Gantt charts
Progress or Gantt charts, introduced in Chapter 20 of Quantitative Approaches in Business Studies, may be constructed in Excel with a little work. Figure 27 show an example of this. The problem: A project has three steps. The first takes 25 days, the second takes 30 days and may begin on the day Step 1 is completed, and the third takes 35 days and may begin 4 days before Step 2 is completed. It is decided to start on 1-June.
Creating Charts in Microsoft Excel 17 The data in A2:A5 summarizes the project in terms of days while A7:C10 does so in date form. The first bar chart is made from the data in B3:C5. Note that Step 1 appears at the top. If you need the chart to read from top to bottom, reverse the order of the data in A2:C5 and A7:C10. We cannot remove the first series but we can hid it by making the bars the same colour as the plot area and removing borders. This gives the second chart. Optionally, you may add text boxes as explained above. Alternatively, note the values on the y-axis tick marks (50, 100 and 150.) Enter these into A13:A15 and enter the formulas shown in B13:B15. We now have dates corresponding to the axis labels the one for the origin is in cell 8. Using the method outlined above (type =, point and click on a date, click the green check mark in the Formula bar) make text boxes for the four labels and position them correctly. This gives the lower chart.
A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
Gantt chart start Step 3 Step 2 Step 1 start Step 1 Step 2 Step 3 start 50 100 150
B
end 51 25 0 end 1-Jun 26-Jun 22-Jul 1-Jun 21-Jul 9-Sep 29-Oct
86 55 25
Step 1
A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Gantt chart Step 3 Step 2 Step 1 start =C4-4 =C5 0
C
end =B3+35 =B4+30 =B5+25 end =$B$12+C5 =$B$12+C4 =$B$12+C3
Step 3
50
100
150
Step 1 Format series 1 area: same as plot area borders: none Optional: add text boxes
26-Jun
Step 2
Step 3
Step 1 Format y-axis Font foreground colour: same as chart area background: transparent Add text box
Step 2
Figure 27
Other topics
A frequently asked question is How do I handle missing data? Suppose you kept records on the number of visitors at your front office each month. However, Jack lost the data for March. You enter the data in a worksheet with no value in the cells for March and make a line chart. The line is broken into two with a gap for March. To avoid this, type =NA() in the March cell this will display as #N/A. The chart will now join the February and April data points.
Creating Charts in Microsoft Excel 18 Quantitative Approaches in Business Studies concludes Chapter 5 with a mention of Excel Frequency function. For information on this and the Histogram tool see the unit called Regression in this supplement. A method to construct a box-and-whisker chart (Chapter 6 of Quantitative Approaches in Business Studies) is shown in the Statistics 1 unit. For more hints on charts, including how to make a dynamic chart, see the authors web site Bernard Liengme