#61
Hack #61
Wouldnt it be nice to create a column chart whose columns can vary in
width and height? Then, as you plot your data into the columns, the columns
width and height cleverly adjust themselves simultaneously.
Excel doesnt provide this feature directly, but by hacking an XY scatter
chart you can create a very effective variable width column chart. XY scatter
charts are used to compare values; therefore, they provide a perfect base on
which to start creating a variable width column chart.
Figure 5-25 shows a variable width column chart that charts the percent
share versus cost for the following expenses: gas, electricity, water, food,
travel, and other. The X axis (the axis along the bottom of the chart) shows
the percentages (%), while the Y axis (the axis on the left-hand side) shows
the cost ($).
Figure 5-25. XY scatter chart set up from range D2:E8
To create this chart, set up some data such as that in Figure 5-25, select
Insert Charts Scatter. Select the first chart subtype: the Scatter with only
markers. Insert an Axis label for the Primary Vertical Axis (Value (Y) axis),
by selecting Chart Tools Layout Labels Axis Titles Primary Vertical Axis Title. When the Axis Title box appears, type Cost ($). (In pre-2007
versions, use the Chart Wizard to create the Scatter chart, and ensure the
chart is created with the columns option selected and is set as an object.)
160
Chapter 5, Charting Hacks