This module will introduce you to basic chart visualization in Excel, Microsoft's long-standing spreadsheet program. We will cover the basics of creating a chart, modifying it, appending new data to it, and varying how different data series are displayed. We will also briefly introduce pivot tables and pivot charts.
Unfortunately, Excel changes their UI with each major release. Our instruction assume Office 365 ProPlus version 15.0.4787.1002 for Windows 8.1 or higher, although any Office 365 version will probably work. For earlier versions of Excel, although most or all of the options may exist in the software, their placement and methods to expose them are likely to be different from our instructions.
To begin, we will construct a basic Excel chart containing two side-by-side bar graphs representing historical maximum and minimum temperatures for Raleigh, NC. We will also overlay a line chart representing historical minimum rainfall for the same Raleigh geographic region.
The instructions below detail, step-by-step, exactly how to build the basic chart, then modify its components to produce a high-quality, perceptually accurate result.
File->Open
, and
choose rdu_month.csv
Insert
tab, click the vertical column
chart icon in the Charts
section of the ribbon, choose
the leftmost 2-D column chart icon, Clustered Column
Max
bars, right-click
and choose Format Data Series...
Series Options
to the
right of the sheet
Series Overlap
value to -25%
Format
Axis...
Axis Options
to the right
of the sheet
Labels
to expand label options
Label Position: Low
from the drop-down menu
Format
Legend...
Legend Options
Legend Position
, choose Right
Font...
Font Size
to 12 point
Chart Tools
tab set, select
the Design
tab
Add Chart Element
button,
choose Axis Titles → Primary Vertical
Insert
tab, choose Symbols
at the end of the ribbon
Symbols
dialog
Format
Axis...
Axis Options
Bounds
, set Minimum
to -10
and Maximum
to 110
Units
, set Major
to 10
Number
to expand number options
Category
, select Number
from the
drop-down menu
Decimal places
Format Code
input field, paste (Ctrl+V) the
degree symbol to the end of the format string, then
click Add
Max
bars
Chart Tools
tab set, select
the Design
tab
Add Chart Element
button,
choose Data Labels → Outside End
Format Data Labels...
Number
to expand number options
Category
, select Number
from the
drop-down menu
Decimal places
Format Code
input field, paste (Ctrl+V) the
degree symbol to the end of the format string, then
click Add
Min
bars, and repeat the
same procedure
Format
Axis...
Axis Options
to the right
of the sheet
Labels
to expand label options
Distance from axis
to 500
Prcp Min
to the chart.
Select Data...
Chart data range
input field, add
",rdu_month!$F$1:$F$13"
Prcp Min
should now show up as a set of small grey
bars
Prcp Min
to a line chart.
Prcp Min
bar, right-click,
choose Change Series Chart Type...
All Charts
tab, choose Combo
in
the list on the left, then select the leftmost
option, Clustered Column - Line
Prcp Min
series, select Secondary
Axis
checkbox
Chart Tools
tab set, select
the Design
tab
Add Chart Element
button,
choose Axis Title → Secondary Vertical
Format Axis...
Axis Options
Number
to expand number options
Category
, select Number
from the
drop-down menu
Decimal places
Max
bar, right-click,
select Format Data Series...
Fill
to expand fill options
Color
, click on the paint bucket, choose
More Colors..
Custom
tab,
choose Color model: RGB
from the drop-down menu, and
enter 27, 158, 119 for Red
, Green
,
and Blue
Min
bar, right-click,
select Format Data Series...
Color
, click on the paint bucket, choose
More Colors..
Custom
tab,
choose Color model: RGB
from the drop-down menu, and
enter 217, 95, 2 for Red
, Green
,
and Blue
Prcp Min
line, right-click,
select Format Data Series...
Color
, click on the paint bucket, choose
More Colors..
Custom
tab,
choose Color model: RGB
from the drop-down menu, and
enter 117, 112, 179 for Red
, Green
,
and Blue
Max
text in the header cell B1
Min
text in the header cell D1
Prcp Min
text in the header cell F1
As a follow-on, we will briefly introduce pivot tables and pivot charts. Pivot tables are a construct in Excel that allows you to aggregate values over one or more categorical data attributes. A very common way to use pivot tables is to aggregate by date, but you are not restricted to using only dates as the aggregation variable. Pivot charts visualize values in a pivot table. As the pivot table's aggregation changes, the chart automatically updates to present the new values.
File->Open
, and
choose rdu_daily.xlsx
Date
EST
, Max
, Mean
, and
Min
), including the headers
Insert
tab, click the line chart icon in
the Charts
section of the ribbon, choose the leftmost
2-D Line icon, Line
This chart does a good job of visualizing the overall trend of maximum, mean, and minimum daily temperatures, showing the expected downward trend as we move from August to December, as well as a number of peaks and valleys. These may be noise, or temperatures that relate to specific events, and may be worth investigating further.
Suppose, however, we wanted to look at the data from a less granular level, for example, by month or by quarter. Pivot tables and pivot charts offer exactly this functionality.
Date
EST
, Max
, Mean
, and
Min
), including the headers
Insert
tab, click
the PivotTable
icon on the left of the ribbon, accept
the defaults and click OK
PivotTable Fields
column to the right of the
sheet, drag DateEst
to the ROWS
region,
and Max
, Mean
, and Min
to
the VALUES
region
Sum of Max
column heading,
and chose Summarize Values By → Average
Grand Total
row
Format Cells...
Category: Number
, and enter 1
for Decimal places
, then click OK
Grand Total
row
Insert
tab, click
the PivotChart
icon, select PivotChart
from the drop-down menu, then select Column
in the list
of All Charts
, and choose the leftmost
icon, Clustered Column
, click OK
Row Labels
column
Group...
Months
and Quarters
in
the By
list, and ensure no other values are selected,
click OK
Qtr3
and choose Field
Settings...
Subtotals & Filters
tab, choose
Custom
for Subtotals, and select Average
in the list of functions
PivotTables have functionality beyond aggregation. They can be used to filter data (for example, clicking on any of the "buttons" in the PivotChart will bring up a dialog that allows you to choose which data to display). They can also "pivot" the data by swapping rows and columns to explore the data in different ways. For more information on PivotTable, you can read Microsoft's introduction to PivotTables or Google search for PivotTable tutorials.