Beruflich Dokumente
Kultur Dokumente
The Data
Time Temperature
Temperature
12:00 AM 28 Chart 1 - Missing Data Not Plotted
60
1:00 AM 27
2:00 AM 27 50
3:00 AM 24 40
4:00 AM 26 30
5:00 AM 32 20
6:00 AM 35 10
7:00 AM 38
0
8:00 AM 40
AM AM AM AM AM AM AM AM AM AM AM AM PM PM PM PM PM PM PM PM PM PM PM PM
9:00 AM 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 :0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:0 9:0 0 :0 1 :0 2 :0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:0 9:0 0 :0 1 :0
1 1 1 1 1 1
10:00 AM 45
11:00 AM 47
12:00 PM 50
Temperature
1:00 PM 52
Chart 2 - Missing Data Not Plotted as Zeros
2:00 PM 52 60
3:00 PM 50 50
4:00 PM 43 40
5:00 PM 30
6:00 PM 36 20
7:00 PM 34
10
8:00 PM 32
0
9:00 PM 30
10:00 PM 29 AM AM AM AM AM AM AM AM AM AM AM AM PM PM PM PM PM PM PM PM PM PM PM PM
: 0 0 :00 :0 0 :0 0 :00 :0 0 :00 :0 0 :0 0 :00 :0 0 :0 0 :0 0 :0 0 :00 :0 0 :0 0 :00 :0 0 :00 :0 0 :0 0 :0 0 :0 0
11:00 PM 28 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11
Temperature
Chart 3 - Missing Data Interpolated
60
50
40
30
20
10
0
AM AM AM AM AM AM AM AM AM AM AM AM PM PM PM PM PM PM PM PM PM PM PM PM
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 :0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:0 9:0 0 :0 1 :0 2 :0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:0 9:0 0 :0 1 :0
1 1 1 1 1 1
Manipulate Chart Series
Chart 1: A column chart using data in Data Range 1 with the quarterly sales values as
the data series and the regions as the categories. Change the Q1 Sales series name from
"Q1 Sales" to "Quarter 1 (Millions"). The plotting order is changed so the quarter 2 series
markers appear to the left of the quarter 1 series markers and "Q2 Sales" is the top row.
of the legend.
Chart 2: A copy of Chart 1 with these changes:
1) All series removed but North, South, East, and West.
2) North, South, East, and West data added for quarters 3 and 4 from Data Range 2.
3) Y-axis scale chaned from $0 to $70 to $0 to $80 and display labels by 20s on the axis
(that is, $0, $20, $40, $60, $80, and $100) instead of by 10s.
4) A chart data table added.
Data Range 1
Region Q1 Sales Q2 Sales
Chart 1
North $50 $55
South $45 $42 $70
Q2 Sales
East $32 $35 $60 Quarter 1 (Millions)
West $58 $50 $50
Central $40 $43
$40
NorthWest $35 $35
NorthEast $30 $28 $30
SouthWest $38 $45 $20
SouthEast $42 $48
$10
$0
Data Range 2 North South East West Central NorthWest NorthEast SouthWest SouthEast
Region Q3 Sales Q4 Sales
North $58 $56
South $41 $40
East $37 $38 Chart 2
$80
West $49 $52
Central $46 $47
NorthWest $37 $34
NorthEast $24 $22 $60
SouthWest $47 $48
SouthEast $48 $45
$40
$20
$0
North South East West
The copy of the chart below has been modified to column from pie.
The SERIES formula has been changed so that Films, Books, and
Music constitute a single data marker with a total of 18 hours and Laundry,
Cooking, and Dusting are a second data marker with a total of 6 hours.
A legend has been included and functions as this chart's title.
Below is the text for the series function that will create this second chart.
=SERIES("Hours Per Week: Entertainment vs. Housekeeping",{"Films, Books & Music","Laundry, Cooking, & Cleaning"},{18,6},1)
When displaying the formula in the worksheet, precede the formula with
a single quote mark so Excel doesn't attempt to interpret the text as an
actual formula.
10
* Note
To create a chart using only a series formula, start the Chart Wizard
Wizard as usual but without selecting any data beforehand. In the
Wizard's Step 1 select a chart type. Click the Wizard's Finish
button immediately. With the empty rectangle the Wizard has
allocated selected (Illustr. 1), click in Excel's Formula Bar enter the
series function that defines your chart. Excel creates the basic
chart (Illustr. 2). Add whatever formatting you like.
Illustr. 1 Illustr. 2
Combination Charts Return to Cont
Create a combination chart by creating a standard chart first and then
converting one or more of the chart series to a different chart type.
Column and Line Combination Chart Column, Area, and Line Combination Chart
$80 $80
$60 $60
$40 $40
$20 $20
$0 $0
North South East West Central North South East West Centra
Q4 Sales Q1 Sales Q2 Sales Q3 Sales Q3 Sales Q4 Sales Q1 Sales Q2 Sale
Excel offers a few built-in combination charts on its Chart Wizard Step 1
on its "Custom Types" tab, but it's easy to customize your own combination.
Return to Contents
Combination Chart
st West Central
Q1 Sales Q2 Sales
A Chart with Two Value Axes
When the data you're charting varies dramatically in scale,
a chart with two value axes may be the best solution. March
The first chart on this worksheet uses a single value axis. April
The second chart is modified so Income values use the left-hand May
Y axis and Profit Margin values use a new right-hand Y axis. June
The left-hand Y axis scale is changed so it ranges from 170,000 July
to 2,970,000 with a "Major Unit" of 700,000. The right-hand August
Y axis scale is changed to start at 9%. September
$3,400,000
$2,550,000
$1,700,000
$850,000 Income
Profit Margin
$-
March April May June July August September
14.0%
$2,270,000
Profit Margin
13.0%
Income
$1,570,000 12.0%
11.0%
$870,000 Income
Profit Margin 10.0%
$170,000 9.0%
March April May June July August September
Profit Margin
13.0%
Income
$1,570,000 12.0%
11.0%
$870,000 Income
Profit Margin 10.0%
$170,000 9.0%
March April May June July August September
Income Profit Margin Return to Contents
$ 2,455,682 12.5%
$ 2,022,515 11.2%
$ 1,899,588 10.1%
$ 2,450,385 14.5%
$ 2,885,626 14.1%
$ 1,993,285 13.2%
$ 1,988,659 10.9%
15.0%
14.0%
Profit Margin
13.0%
12.0%
11.0%
10.0%
9.0%
tember
Profit Margin
13.0%
12.0%
11.0%
10.0%
9.0%
tember
Examples of Charts with Graphical Fills
Line Chart Plot Area with Graphical Fill Plot Area with Graphical Fill and Cha
$3,000,000 14.0%
12.0% $3,000,001
$2,500,000
10.0%
$2,000,000 $2,500,001
8.0%
$1,500,000 $2,000,001
6.0%
$1,000,000
4.0% $1,500,001
$500,000
2.0%
$1,000,001
$- 0.0%
March April May $500,001
$1
March Apri
Chart Data
Jun
Quarter 1 Quarter 2 Quarter 3
Apr 12 3 56
Feb 145 5 44 May
Mar 16 88 67
Apr
Mar
Feb
January
0 10
Return to Contents
rea with Graphical Fill and Chart Series with Graphical Fill
$3,000,001
$2,500,001
$2,000,001
$1,500,001
$1,000,001
$500,001
$1
March April May
Quarter 1
Quarter 2
Quarter 3
hart and paste special as a picture to separate the chart
underlying data. Ungroup the elements to manipulate them.
New Data
Old Data
10 20 30 40 50 60
Dynamic Chart Titles
Make chart titles dynamic if you want them to change
automatically as values in your worksheet change.
Q1 Q2 Q3
Feb 104 75 56 Referenced value: Southern (Change this value to change the c
Mar 115 86 44
Concatenation: Values from the Southern Region
uthern Region
10 1930
8 1940
1950
6
1960
4
1970
2
1980
0 1990
0 500 1000 1500 2000 2500 1999
Year (plotted against population figures)
2000
2010
Population Growth: Line Chart 2020
12 2030
2040
Population (billions)
10
8 2050
2100
6
2150
4
0
0 50 50 50 10 30 50 70 90 00 20 40 00
12 17 18 19 19 19 19 19 20 20 20 21
Year (plotted as category values)
Data
Return to Contents
Population (billions)
0.01
0.20
0.40
0.65
0.78
0.90
1.20
1.65
1.75
1.85
1.95
2.05
2.59
2.70
3.10
3.80
4.30
4.85
5.40
5.95
6.50
8.11
8.58
8.91
9.46
9.75
Misleading Scales/Consistent Chart Scales
If creating several charts of like data, it's often best to Survey Question 1 Responses
make sure the chart scales remain the same so the data Excellent
can be compared accurately across charts. The first two Very Good
charts below appear to be charting data that's quite similar, Good
but this is because the value scales are different. See the Not Good
third chart below that uses the same scale as the first. Unsatisfactory
Very Good
Excellent
0.0% 5.0% 10.0% 15.0% 20.0% 25.0% 30.0% 35.0% 40.0% 45.0%
Unsatisfactory
Not Good
Good
Very Good
Excellent
0.0% 2.0% 4.0% 6.0% 8.0% 10.0% 12.0% 14.0% 16.0% 18.0%
This third chart is based on fewer responses. The scale of this chart matches the scale
of the first chart, making it easier to compare responses accurately across charts.
Unsatisfactory
Not Good
Good
Survey Question 2 Responses (Scale 0-50%)
Unsatisfactory
Not Good
Good
Very Good
Excellent
03
/ 20
7
/ 2 03
10 /20
5
/ 2 03
10 /20
3
/ 2 03
10 /20
1
/ 2 03
10 /20
9
/ 1 03
10 /20
7
/ 1 03
10 /20
5
/ 1 03
10 /20
3
/ 1 03
10 /20
1
/1 0 3
10 /20
/9 3
10 00
/2
/7 3
10 00
/2 $0.0 $1.0 $2.0 $3.0 $4.0 $5.0 $6.0 $7.0
/5
10
If you prefer you can turn off this Excel charting feature. Open the
"Chart Options" dialog for the chart and on the "Axes" tab change
the selected option for the category axis from "Automatic" to "Category".
Sales (Thousands)
10/28/2003
Dates From the Data Only
10/24/2003
10/23/2003
10/18/2003
10/12/2003
10/7/2003
10/24/2003
10/18/2003
10/12/2003
10/7/2003
10/5/2003
20
15
10
0
China Japan Croatia Russia Canada Mexico
Far East Eastern Europe West
To correct Excel's interpretation of the data, use the "Series" tab in the
"Source Data" chart dialog. Note that data used for the multiple category
names must be contiguous.
25
20
Number of Contacts Made
15
10
0
10 11 10 11 10 11
China Japan Croatia Russia Canada Mexico
Far East Eastern Europe West
Number of Conta
10
0
10 11 10 11 10 11
China Japan Croatia Russia Canada Mexico
Far East Eastern Europe West
Category Labels
Data to Chart
Region Countries Month Contacts Return to Contents
Far East China 10 15
Japan 11 16
Eastern Europe Croatia 10 12
Russia 11 10
West Canada 10 18
Mexico 11 23
Controlling Chart Tick Mark Labels Data to Chart
With some charts you may want to override Excel's -5
standard positioning of tick mark labels -3
-1
3
Standard Tick Mark Label Position
5
Tick Mark Position
8
10
0
1 2 3 4 5 6
-2
-4
-6
10
-2
-4
-6
1 2 3 4 5 6
-2
-4
-6
1 2 3 4 5 6
1 2 3 4 5 6
10
-2
-4
-6
Return to Contents
Labeling XY and Bubble Chart Data Points
Excel has no way for you to specify a range of text to be used as
data labels for the values plotted in XY or Scatter charts. Labels
can be added manually, or third-party utilities are available to
make a labeling feature available to your XY chart. Microsoft also
provides instructions* on its Knowledge Base website for creating
a VBA program to add XY labels. That VBA code is used to label
the data points in the scatter and bubble plot examples here.
16
15
Demand
12 12
10
8 8
5
4
0
$20 $25 $30 $35 $40 $45
Price
* See http://support.microsoft.com/default.aspx?scid=kb;en-us;213750
SUMMARY
Excel has no built-in commandto automatically attach text labels to
data points in an xy (scatter) or Bubble chart. However, you can create a
Visual Basic for Applications macro that does this. Below is a macro that
performs this task on an XY Scatter chart. It can also be used for a Bubble Chart.
The sample code in this article assumes that the data and associated labels
are arranged in a worksheet according to the following format: The first
column contains the data labels. The second column contains the x values
for the xy (scatter) chart. The third and subsequent columns contain the y
values for the xy (scatter) chart.
NOTE: Although the example provided contains only one column of data for
y values, you can use more than one series of data.
To use the macro described here, create a chart using the following data:
NOTE: The table should not contain empty columns, and the column that contains the
data labels should not be separated from the column that contains the x values. The
labels and values must be laid out in exactly the format described in this article
(the location of the upper-left cell does not have to be cell A1).
To attach text labels to data points in an xy (scatter) chart, follow these steps:
- Create an XY chart in the usual fashion.
- Press ALT+F11 to open Excel's Visual Basic for Applications environment.
- On the VBA Insert menu, click Module to create a code window.
- Type the following sample code in the module sheet (or copy & paste from here):
Sub AttachLabelsToPoints()
'Dimension variables.
Dim Counter As Integer, ChartName As String, xVals As String
' Disable screen updating while the subroutine is run.
Application.ScreenUpdating = False
'Store the formula for the first series in "xVals".
xVals = ActiveChart.SeriesCollection(1).Formula
'Extract the range for the data from xVals.
xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, _
Mid(Left(xVals, InStr(xVals, "!") - 1), 9)))
xVals = Left(xVals, InStr(InStr(xVals, "!"), xVals, ",") - 1)
Do While Left(xVals, 1) = ","
xVals = Mid(xVals, 2)
Loop
'Attach a label to each data point in the chart.
For Counter = 1 To Range(xVals).Cells.Count
ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _
Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
Next Counter
End Sub
- Press ALT+Q to return to Microsoft Excel.
- Select the chart.
- From Excel's menus choose Tools, Macro, Macros. Click AttachLabelsToPoints
and then click Run to run the macro.
The macro automatically associates the labels with the data points on the chart.
Bubble Size**
Netsuke Price Demand Availability Return to Contents
Kirin $22 8 3
Badger $38 12 5
Foo Dog $32 10 4
Bean Thrower $42 5 1
Mirror Polisher $28 15 8
12
Demand
8
5
4
$45 $15 $20 $25 $30 $35 $40 $45
Price
** This column of data is used in the bubble chart only. The bubble size
gives a quick visual indication of the "availability" dimension in the data.
ubble Chart.
that contains the
e x values. The
nvironment.
",") - 1)
sDataLabel = _
ataLabel.Text = _
hLabelsToPoints,
6,000
4,500
Labrador
Corgi
Bedlington
3,000
1,500
-
2000 2001 2002
View 4: The 3-D chart with a Z Value axis added. The data isn't all
visible in this view and with this arrangement of the data. The "Chart Options" dialog
6,000
4,500
3,000
1,500
Bedlington
- Corgi
2000
2001 Labrador
2002
View 6: The data series modified so all data is visible; the chart rotated. The "Format Data Series" d
6,000
4,500
3,000
1,500
Labrador
Corgi
2002
Bedlington
2001
2000
Corgi
2002
Bedlington
2001
2000
Chart Data Return to Contents
Labrador Corgi Bedlington
2,030 524 82
4,325 638 104
5,112 929 203
6,000
4,500
3,000
1,500
6,000
4,500
3,000
1,500
-
2000 B
2001 Corgi
2002 Labrador
The "Format Data Series" dialog with its "Series Order" tab.
ective altered by dragging the Corners element.
Labrador
Corgi
Bedlington
2001 2002
Use the "Chart Options" "3-D View" dialog and its Default
3-D view of the data. button to return the chart to a standard perspective.
Bedlington
1 Corgi
2002 Labrador