<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peltier Tech Blog &#187; Chart Types</title>
	<atom:link href="http://peltiertech.com/WordPress/category/chart-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Wed, 16 May 2012 17:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Excel Fan Chart Showing Uncertainty in Projections</title>
		<link>http://peltiertech.com/WordPress/excel-fan-chart-showing-uncertainty-in-projections/</link>
		<comments>http://peltiertech.com/WordPress/excel-fan-chart-showing-uncertainty-in-projections/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 13:32:57 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[Fan Chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3394</guid>
		<description><![CDATA[A reader emailed me this chart of GDP, with actual values through late 2008 and projected values for the next two years. To illustrate the uncertainty in the predictions, colored bands were drawn alongside the solid line prediction. The bands become lighter as the distance from the prediction line increases. Because of this appearance, showing [...]]]></description>
			<content:encoded><![CDATA[<p>A reader emailed me this chart of GDP, with actual values through late 2008 and projected values for the next two years. To illustrate the uncertainty in the predictions, colored bands were drawn alongside the solid line prediction. The bands become lighter as the distance from the prediction line increases. Because of this appearance, showing the data fanning out, this type of chart is called a Fan Chart.</p>
<p>The reader wondered how to create this shaded-band effect in a fan chart. This tutorial was developed using Excel 2010, but the procedure is applicable to all Excel versions.</p>
<p>The chart comes from page 34 of <a href="http://www.cbo.gov/ftpdocs/100xx/doc10014/03-20-PresidentBudget.pdf" rel="nofollow" class="vt-p" title="A Preliminary Analysis of the President's Budget and an Update of CBO's Budget and Economic Outlook" >A Preliminary Analysis of the President&#8217;s Budget and an Update of CBO&#8217;s Budget and Economic Outlook</a>, published in March 2009 by the Congressional Budget Office.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2009-03/Uncertain00.jpg" alt="Example Fan Chart" width="619" height="334" /></p>
<p><span id="more-3394"></span>I&#8217;ve manually digitized the actual data up to 10/1/08 and the projections from 1/1/09 onward into this tall thin tower of numbers.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2009-03/UncertainData01.png" alt="Actual and Projected Data" width="129" height="443" /></p>
<p>Here is the data plotted in a line chart.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain10.png" alt="" width="639" height="271" /></p>
<p>I&#8217;ve set up the following table to capture the data for the fan. Midline contains the actual and projected values from above. I made up Min and Max so that the fan would grow wider for each successive quarter. I then created values in a and b to split the fan below the midline into three shades of gray, and in c and d to split the fan above the midline into the same three shades of gray. You can use more or fewer calculated columns to increase or decrease the number of shaded regions.</p>
<p>My numbers are arbitrarily calculated. If you have some probabilistic means of generating such values, you should use your calculations instead.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2009-03/UncertainData02.png" alt="Line Chart Data for Fan Chart" width="513" height="443" /></p>
<p>When I add these columns of data as additional lines in the chart, I get the following chart. I&#8217;ve changed the default kaleidoscope of line colors to shades of gray that lighten with increasing distance from the midline. The labels indicate which column in the table above contains data for each line. This chart is fine, but it doesn&#8217;t show the filled area effect.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain11.png" alt="" /></p>
<p>To achieve filled regions, I will use a stacked area chart. In an adjacent range I&#8217;ve added the following table. The dates are the same, as are the minimum and midline predictions. The rest of the data are calculated differences between each line and the previous line, to capture the height of each colored band (distance between lines). For example, the Max value for 1/1/09 in the table below (33) is the difference between the Max value for 1/1/09 in the table above and the d value for 1/1/09 in the table above (11400 minus 11367).</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2009-03/UncertainData03.png" alt="Area Chart Data for Fan Chart" width="513" height="443" /></p>
<p>I&#8217;ve created a stacked area chart using this table of data. Here are my colored bands.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain12.png" alt="Fan Chart Step 1: Stacked Area Chart" width="639" height="271" /></p>
<p>The first thing I did was format the axes and delete the gridlines.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain13.png" alt="Fan Chart Step 2: Format Axes" width="639" height="271" /></p>
<p>Then I converted the Midline series to a Line Chart. This is done by right-clicking on the series, choosing Change Chart Type (or simply Chart Type in older Excel versions), and selecting a line chart style.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain14.png" alt="Fan Chart Step 3: Convert Midline to Line Chart" width="639" height="271" /></p>
<p>Next I made the Min series invisible by formatting it to have no fill.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain15.png" alt="Fan Chart Step 4: Make Min Series Invisible" width="639" height="271" /></p>
<p>Then I rescaled the vertical axis, because I don&#8217;t want all that empty space at the bottom.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain16.png" alt="Fan Chart Step 5: Reset Vertical Axis Scale" width="639" height="271" /></p>
<p>Finally I formatted the Midline to use dark gray for its line, and the area series to have lighter and lighter gray fills the further they are from the midline. I&#8217;ve also deleted the legend.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/Uncertain17.png" alt="Fan Chart Step 6: Format Line and Fill Colors" width="639" height="271" /></p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://peltiertech.com/Utility/" rel="nofollow"  title="PTS Chart Utilities: Waterfall, Cluster-Stack Column, Box and Whisker, Marimekko"><img src="http://peltiertech.com/Utility/pix/pts_banner_map.png" alt="PTS Chart Utilities: Waterfall, Box and Whisker, Cluster-Stack, Panel, Marimekko, Dot, Panel" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/excel-fan-chart-showing-uncertainty-in-projections/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OHLC Stock Chart with Tick Marks in Microsoft Excel</title>
		<link>http://peltiertech.com/WordPress/ohlc-stock-chart-with-tick-marks-in-microsoft-excel/</link>
		<comments>http://peltiertech.com/WordPress/ohlc-stock-chart-with-tick-marks-in-microsoft-excel/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 07:00:49 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[error bars]]></category>
		<category><![CDATA[stock chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3383</guid>
		<description><![CDATA[Candlestick Charts Microsoft Excel has some built-in chart types for displaying how stock prices vary during a trading period. This is usually a day, but it could also show weeks, months, or years, or even intervals of minutes or hours during a trading day. These are the prices at open and close of the market [...]]]></description>
			<content:encoded><![CDATA[<h2>Candlestick Charts</h2>
<p>Microsoft Excel has some built-in chart types for displaying how stock prices vary during a trading period. This is usually a day, but it could also show weeks, months, or years, or even intervals of minutes or hours during a trading day. These are the prices at open and close of the market as well as the high and low while the market is open. For example, the Open-High-Low-Close (OHLC) candlestick chart below was designed to show the high and low for a trading period as the top and bottom of the vertical line for each period, and the change from open to close as a rectangle, filled white for an increasing value or black for a decreasing value.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-candlestick.png" alt="Open-High-Low-Close Candlestick Chart in Excel" width="447" height="289" /></p>
<p>To make this chart type, you need five columns of data, in order Date (or other label of the trading period), Open, High, Low, and Close. If you omit the dates or labels, Excel will build the chart and label the periods 1, 2, 3, etc. Select the data, then go to the Insert tab &gt; Other Charts, and pick the second stock chart type.</p>
<p>I guess I&#8217;m too dumb to remember such a straightforward convention, but I always have to check whether the white or black bars refer to increasing or decreasing values. So I like to color the bars red and green, like so:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-color-candles.png" alt="Open-High-Low-Close Candlestick Chart with Color Coded Candles" width="447" height="289" /></p>
<p>The problem is that the colored bars do not photocopy well in black and white. Also, while the red and green colors in Excel&#8217;s default theme are distinguishable by most people with color vision deficiencies, I can&#8217;t imagine the colors they see are as easy to distinguish as red and green, or as black and white, for that matter.</p>
<h2>Stock Charts with Open and Close Tickmarks</h2>
<p>The best approach then is to use the OHLC chart style found in newspapers. These have a vertical line to indicate the spread from low to high during a trading period, with a small tickmark to the left indicating the opening price and a small tickmark to the right at the closing price. Excel has a High-Low-Close stock chart with the vertical line and a single tickmark, to the right, to signify closing price. But no leftward tickmark.</p>
<p>So we must resort to some smoke and mirrors. Actually, some short horizontal error bars will serve as our tickmarks.</p>
<p>Start with the data arranged in the same way, but create a line chart instead of a stock chart.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-OHLC-linechart.png" alt="Line Chart Using OHLC Data" width="447" height="289" /></p>
<p>Select any series in the chart, go to the Chart Tools &gt; Layout tab, click on Lines, and choose High-Low Lines.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-high-low-lines.png" alt="Line Chart with High-:ow Lines" width="447" height="289" /></p>
<p>Format the High and Low series to remove the line color.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-hide-high-low-series.png" alt="OHLC Line Chart with High Low Lines Hidden" width="447" height="289" /></p>
<p>Change the Open and Close series to XY: right click on each series in turn, select Change Chart Type, and choose an XY type.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-change-to-xy.png" alt="OHLC Chart with Open and Close Changed to XY" width="447" height="288" /></p>
<p>These XY points don&#8217;t line up and there are misaligned secondary axes, but this is simple to fix. Format both XY series to assign them to the primary axis.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-xy-to-primary.png" alt="XY Series Moved to Primary Axis" width="447" height="289" /></p>
<p>Format the Open and Close series to hide the markers.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-hide-markers.png" alt="OHLC chart with Invisible Open and Close Markers" width="447" height="289" /></p>
<p>Select the Open and Close series in turn, and add error bars. There are no markers to click on, but if you select the chart you can find the Chart Element selector on the Chart Tools &gt; Layout and Format tabs. The Chart Element selector and the pop-up tool tip are highlighted with a red border in this screen shot. This is a handy tool to add to your arsenal.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/select-chart-element.png" alt="Chart Element Selector in the Ribbon" width="288" height="330" /></p>
<p>Use the Chart Element selector to select the Open and Close series, one at a time. (You could also select a visible series or another visible chart element, and use the up or down arrows to cycle through the chart&#8217;s elements until the desired series is selected.)</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/select-series.png" alt="Select a Series Using the Chart Element Selector" width="288" height="330" /></p>
<p>With the series selected, go to the Chart Tools &gt; Layout tab, select Error Bars, and choose one of the options. I simply used the Standard Error option, since it was easier to add everything and adjust or remove the parts as needed. Repeat for both Open and Close.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-add-error-bars.png" alt="Open and Close Series with Error Bars" width="447" height="289" /></p>
<p>Reminds me of a swarm of starfighters from Star Wars.</p>
<p>Select the vertical (Y) error bars for each series. You may want to use the Chart Element selector for this.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/select-error-bars.png" alt="Select Error Bars Using the Chart Element Selector" width="288" height="330" /></p>
<p>Select the vertical (Y) error bars, and remove them by pressing the Delete key.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-hide-y-error-bars.png" alt="Vertical Error Bars Are Gone" width="447" height="288" /></p>
<p>Select the &#8220;Open&#8221; X Error Bars, and press Ctrl+1 to open the Format dialog. Select the Minus direction and the No Cap end style, and enter a fixed value of 0.4.</p>
<p>Select the &#8220;Close&#8221; X Error Bars, and press Ctrl+1 to open the Format dialog. Select the Plus direction and the No Cap end style, and enter a fixed value of 0.4.</p>
<p>The vertical lines are one unit (one trading period) apart, so 0.4 reaches almost halfway to the next vertical line on either side.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-03/msft-size-x-error-bars.png" alt="Error Bars Have Become Open and Close Tickmarks" width="447" height="289" /></p>
<p>This style of OHLC chart works well in black and white, and after the first time you go through the protocol, it doesn&#8217;t take too long to set up.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/ohlc-stock-chart-with-tick-marks-in-microsoft-excel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Easy Two-Panel Line Chart in Excel</title>
		<link>http://peltiertech.com/WordPress/easy-two-panel-line-chart-in-excel/</link>
		<comments>http://peltiertech.com/WordPress/easy-two-panel-line-chart-in-excel/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 08:00:19 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[Panel Charts]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3378</guid>
		<description><![CDATA[I&#8217;ve written often about panel charts, and I&#8217;ve made some simple ones, but I don&#8217;t seem to have explained the process in enough detail for people to reproduce these simple ones with their own data. Easy Two-Panel Column Chart in Excel was the first of several quick tutorials on easy panel charts. This article shows [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written often about panel charts, and I&#8217;ve made some simple ones, but I don&#8217;t seem to have explained the process in enough detail for people to reproduce these simple ones with their own data. <a href="http://peltiertech.com/WordPress/easy-two-panel-column-chart-in-excel/"class="vt-p" title="Easy Two-Panel Column Chart in Excel" rel="bookmark" >Easy Two-Panel Column Chart in Excel</a> was the first of several quick tutorials on easy panel charts. This article shows the instructions for a two-panel line chart.</p>
<p style="text-align: center;"><span style="color: #ff00ff;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines12.png" alt="Two Panel Line Chart" width="320" height="221" /></span></p>
<p><img title="More..." src="http://peltiertech.com/WordPress/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" />Let&#8217;s use the following simple data for this exercise.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopaneldata.png" alt="Data for two-panel chart" width="228" height="137" /></p>
<p><span id="more-3378"></span>Values for the two data series fall within vastly different ranges, as seen in this line chart.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines01.png" alt="Starting Line Chart" width="320" height="221" /></p>
<h2>Problems with Primary and Secondary Axis Line Charts</h2>
<p>When we move the Secondary series to the secondary axis, there is an apparent relationship between the series, which changes as the axis scales are changed. It is hard to separate the data, despite the presence of the two axes. Who can figure out, let alone remember, which data should be measured against which axis? Our eyes see the series overlapping, and our brain interprets them as having overlapping data ranges.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines02.png" alt="Line Chart with Primary and Secondary Y Axes" width="320" height="221" /></p>
<p>Here the series start out far apart, one much higher than the other for several months. By the end of the year, they have switched places.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines03.png" alt="Line Chart Fixed to Unhide Primary Data" width="320" height="221" /></p>
<p>In contrast, the data in this chart starts the same, but after several months the two series suddenly diverge.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines04.png" alt="Line Chart with Color Coded Primary and Secondary Axes" width="320" height="221" /></p>
<p>But it&#8217;s the same data in both of the previous charts. Through intentional or inadvertent axis scale dishonesty, you can tell any story you want.</p>
<h2>The Panel Chart, Step-by-Step</h2>
<p>You can avoid the problems with two-axis charts by plotting the data in separate panels. Start your panel chart by making a line chart with the data.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines01.png" alt="Starting Column Chart" width="320" height="221" /></p>
<p>Right click the Secondary series, choose Format Series (or similar, it varies with Excel version), and select the Secondary Axis option.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines02.png" alt="Column Chart with Primary and Secondary Y Axes" width="320" height="221" /></p>
<p>We have primary and secondary Y axes, but only the primary X axis. Add the secondary X axis. In Excel 2007/2010, go to the Chart Tools &gt; Layout tab, click on Axes, and for Secondary Horizontal Axis, select Show Left to Right Axis. In Excel 97-2003, go to the Chart menu &gt; Chart Options, and on the Axes tab, under Secondary X Axis, choose the Category option.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines05.png" alt="Column Chart with Primary and Secondary X and Y Axes" width="320" height="221" /></p>
<h3>Explanation of Required Axis Formatting</h3>
<p>What we want is a chart divided into two panels like the chart below shows. I&#8217;ve temporarily hidden the plotted data, but you don&#8217;t need to.</p>
<p>The primary axis above spans 0 to 200. To plot the Primary series in the bottom panel, the primary Y axis must span 0 to 200 in the bottom panel, or 0 to 400 overall (the same amount in the top and bottom panels).</p>
<p>The secondary axis above spans 0 to 2000. To plot the Secondary series in the top panel, the primary Y axis must span 0 to 2000 in the top panel, or -2000 to 2000 overall (the same amount in the top and bottom panels). Since the secondary axis crosses at zero, it forms the dividing line in the middle of the chart.</p>
<p>If you have nice data, or if you&#8217;re good at algebra, you can pick axis scale parameters that align the axis tick marks on the left and right sides of the chart. The temporary gridlines in this chart show how nicely aligned these tick marks can be.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines06.png" alt="Frame of Two Panel Column Chart" width="320" height="221" /></p>
<p>So the Primary series fits into the bottom panel. . .</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines07.png" alt="Two Panel Line Chart Primary Data in Bottom Panel" width="320" height="221" /></p>
<p>. . . and the Secondary series fits into the top panel.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines08.png" alt="Two Panel Line Chart Secondary Data in Top Panel" width="320" height="221" /></p>
<h3>Apply Axis Settings and Continue</h3>
<p>Here is how the chart looks with the desired axis scales applied, and with the data unhidden.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines09.png" alt="Two Panel Line Chart, Axes Need Fixing" width="320" height="221" /></p>
<p>We will use the secondary horizontal axis as the panel separator. Right click the secondary (right) Y axis, choose Format Axis, and change the Horizontal Axis Crosses setting to Automatic (which means it crosses at zero).</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines10.png" alt="Two Panel Line Chart, Y Axis Labels Need Fixing" width="320" height="221" /></p>
<p>We still need to do some cleanup. The month names in the middle of the chart are redundant, and easy to remove. Right click on the axis, choose Format Axis, and for Axis Ticks and Tick Labels, choose None.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines11.png" alt="Two Panel Line Chart, Axes Fixed" width="320" height="221" /></p>
<p>There is now an open space across the top of the chart where the secondary horizontal axis was. We can close it by applying an appropriate border color to the plot area.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines12.png" alt="Two Panel Line Chart" width="320" height="221" /></p>
<p>We need to apply some number format magic to the Y axis labels: we only want primary axis labels in the bottom, and secondary axis labels in the top, of the chart. I&#8217;ve written an article about <a href="http://peltiertech.com/Excel/NumberFormats.html" rel="nofollow" class="vt-p" title="Number Formats in Excel" >Number Formats in Excel</a>, but there&#8217;s room for a quick refresher class.</p>
<p>The secondary (right) axis is easy. We need a format like &#8220;0;;0;&#8221;. A number format has up to four elements, separated by semicolons. The first indicates what format to apply to positive numbers, the second to negative numbers, the third to zero values, and the fourth to text. A number format of &#8220;0&#8243; means simply show the numerical value without any decimal digits; &#8220;0.0&#8243; would mean show one decimal digit, &#8220;0.00&#8243; two decimal digits, etc. A missing format means don&#8217;t show anything. So this format tells Excel to format positive and zero values as whole numbers, and don&#8217;t show anything else.</p>
<p>The primary (left) axis is a bit trickier, but we can use simple conditions to turn formats on and off. The format we need is &#8220;[&lt;=200]0;&#8221;. The expression in square brackets is the condition that sets the format. It says to display any number of value equal to or less than 200 as a whole number, and don&#8217;t display anything else. These conditions override the default positive-negative-zero sequence, but we can only apply two conditions, like &#8220;[one condition]format;[another condition]format;[all other numbers]format;[text]format&#8221;.</p>
<p>Right click each axis and choose Format Axis. Select the Number tab of the dialog, click on Custom, and enter the appropriate format into the box (without the quotes). Don&#8217;t forget to click the Add button, or Excel will discard your carefully typed format.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines13.png" alt="Two Panel Line Chart" width="320" height="221" /></p>
<p>You can apply data labels to identify the series in your chart. Here I&#8217;ve applied series name labels to point 4 of the Primary series and to point 2 of the Secondary series.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines14.png" alt="Two Panel Line Chart" width="320" height="221" /></p>
<p>We can&#8217;t resize the data labels, but I&#8217;ve removed that unsightly line wrapping in the Secondary label by shrinking the font size by 0.5 points. A better decision would have been to use free-floating text boxes for these labels, but I like to use data labels which are anchored to the data points.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines15.png" alt="Two Panel Line Chart" width="320" height="221" /></p>
<p>You can stretch the chart if you want more resolution in the Y values. (My data labels needed further shrinking. Should have used text boxes.)</p>
<p><img class="aligncenter" style="border-style: initial; border-color: initial; text-align: center;" src="http://peltiertech.com/images/2012-02/twopanellines16.png" alt="Two Panel Line Chart" width="282" height="306" /></p>
<p>It would have been easy enough to switch the panels. In the next chart, the primary Y axis is scaled from -200 to 200, and the number format is &#8221;0;;0;&#8221;. The secondary Y axis is scaled from 0 to 4000, and the number format is &#8221;[&lt;=2000]0;&#8221;.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanellines17.png" alt="Two Panel Line Chart" width="282" height="306" /></p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/easy-two-panel-line-chart-in-excel/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Easy Two-Panel Column Chart in Excel</title>
		<link>http://peltiertech.com/WordPress/easy-two-panel-column-chart-in-excel/</link>
		<comments>http://peltiertech.com/WordPress/easy-two-panel-column-chart-in-excel/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 08:00:12 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[Panel Charts]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3377</guid>
		<description><![CDATA[I&#8217;ve written frequently about panel charts, and I&#8217;ve made some simple ones, but I don&#8217;t seem to have explained the process in enough detail for people to reproduce them with their own data. This is one of several quick tutorials on easy panel charts. This article also answers the question, &#8220;How do I fix a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written frequently about panel charts, and I&#8217;ve made some simple ones, but I don&#8217;t seem to have explained the process in enough detail for people to reproduce them with their own data. This is one of several quick tutorials on easy panel charts.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols12.png" alt="Two Panel Column Chart" width="282" height="306" /></p>
<p>This article also answers the question, &#8220;How do I fix a column chart that has some series on the primary axis and some on the secondary axis?&#8221; The problem is that the secondary columns obscure the primary columns. Well, you can offset the columns so the primary ones are no longer obscured, but a far better approach is to offset the series, into separate panels for primary and secondary data.</p>
<p><span id="more-3377"></span>Let&#8217;s use the following simple data for this exercise.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopaneldata.png" alt="Date for two-panel chart" /></p>
<p>Values for the two data series fall within vastly different ranges, as seen in this column chart.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols01.png" alt="Starting Column Chart" width="320" height="221" /></p>
<h2>Problems with Primary and Secondary Axis Column Charts</h2>
<p>When we move the Secondary series to the secondary axis, we can see all the Secondary points, but only the tallest of the Primary points peek out from behind the shortest Secondary points.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols02.png" alt="Column Chart with Primary and Secondary Y Axes" width="320" height="221" /></p>
<p>It&#8217;s possible to juggle hidden series to offset the primary and secondary data to either side. This doesn&#8217;t make the chart any easier to read than the original one-axis-scale chart we started with. Who can figure out, let alone remember, which data should be measured against which axis?</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols03.png" alt="Column Chart Fixed to Unhide Primary Data" width="320" height="221" /></p>
<p>You can play the color-coding game, coloring all the axis labels and legend labels to match the bar colors. And it makes perfect sense to you. But that&#8217;s because you made the chart and did all the formatting. Show your handiwork to someone who hasn&#8217;t been working with the data, and the color-coded chart is clear as mud. And that&#8217;s if you&#8217;re showing it to someone with normal color vision.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols04.png" alt="Column Chart with Color Coded Primary and Secondary Axes" width="320" height="221" /></p>
<p>Don&#8217;t try to figure out this approach. The chart is just not easy to read.</p>
<h2 style="text-align: left;">The Panel Chart, Step-by-Step</h2>
<p style="text-align: left;">Start your panel chart by making a column chart with the data.</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2012-02/twopanelcols01.png" alt="Starting Column Chart" width="320" height="221" /></p>
<p>Right click the Secondary series, choose Format Series (or similar, it varies with Excel version), and select the Secondary Axis option.</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2012-02/twopanelcols02.png" alt="Column Chart with Primary and Secondary Y Axes" width="320" height="221" /></p>
<p>We have primary and secondary Y axes, but only the primary X axis. Add the secondary X axis. In Excel 2007/2010, go to the Chart Tools &gt; Layout tab, click on Axes, and for Secondary Horizontal Axis, select Show Left to Right Axis. In Excel 97-2003, go to the Chart menu &gt; Chart Options, and on the Axes tab, under Secondary X Axis, choose the Category option.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols05.png" alt="Column Chart with Primary and Secondary X and Y Axes" width="320" height="221" /></p>
<p>The Secondary series is hanging from the rafters, because the bars reach from the axis, which by default is at the top of the chart, down to the value.</p>
<p>Right click the secondary (right) Y axis, choose Format Axis, and change the Horizontal Axis Crosses setting to Automatic (which means it crosses at zero). In Excel 2007/2010, the secondary axis appears below the primary axis, while in Excel 97-2003, the secondary axis doesn&#8217;t appear.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols05a.png" alt="Column Chart with Primary and Secondary X and Y Axes" width="320" height="221" /></p>
<p>Give the plot area an appropriate line color, so there are lines on all four edges of the chart.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols05b.png" alt="Column Chart with Primary and Secondary X and Y Axes" width="320" height="221" /></p>
<h3>Explanation of Required Axis Formatting</h3>
<p>What we want is a chart divided into two panels like the chart below shows. I&#8217;ve temporarily hidden the plotted data, but you don&#8217;t need to.</p>
<p>The primary axis above spans 0 to 200. To plot the Primary series in the bottom panel, the primary Y axis must span 0 to 200 in the bottom panel, or 0 to 400 overall (the same amount in the top and bottom panels).</p>
<p>The secondary axis above spans 0 to 2000. To plot the Secondary series in the top panel, the primary Y axis must span 0 to 2000 in the top panel, or -2000 to 2000 overall (the same amount in the top and bottom panels). Since the secondary axis crosses at zero, it forms the dividing line in the middle of the chart.</p>
<p>If you have nice data, or if you&#8217;re good at algebra, you can pick axis scale parameters that align the axis tick marks on the left and right sides of the chart. The temporary gridlines in this chart show how nicely aligned these tick marks can be.</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2012-02/twopanelcols06.png" alt="Frame of Two Panel Column Chart" width="320" height="221" /></p>
<p>So the Primary series fits into the bottom panel. . .</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols07.png" alt="Two Panel Column Chart Primary Data in Bottom Panel" width="320" height="221" /></p>
<p>. . . and the Secondary series fits into the top panel.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols08.png" alt="Two Panel Column Chart Secondary Data in Top Panel" width="320" height="221" /></p>
<h3>Apply Axis Settings and Continue</h3>
<p>Here is how the chart looks with all of the axis settings applied, and with the data unhidden.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols09.png" alt="Two Panel Column Chart, Axes Need Fixing" width="320" height="221" /></p>
<p>We still need to do some cleanup. The month names in the middle of the chart are redundant, and we only want primary axis labels in the bottom, and secondary axis labels in the top, of the chart.</p>
<p>The unneeded month labels are easy to remove. Right click on the axis, choose Format Axis, and for Axis Ticks and Tick Labels, choose None.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols10.png" alt="Two Panel Column Chart, Y Axis Labels Need Fixing" width="320" height="221" /></p>
<p>We need to apply some number format magic to the Y axis labels. I&#8217;ve written an article about <a href="http://peltiertech.com/Excel/NumberFormats.html" rel="nofollow" class="vt-p" title="Number Formats in Excel" >Number Formats in Excel</a>, but there&#8217;s room for a quick refresher class.</p>
<p>The secondary (right) axis is easy. We need a format like &#8220;0;;0;&#8221;. A number format has up to four elements, separated by semicolons. The first indicates what format to apply to positive numbers, the second to negative numbers, the third to zero values, and the fourth to text. A number format of &#8220;0&#8243; means simply show the numerical value without any decimal digits; &#8220;0.0&#8243; would mean show one decimal digit, &#8220;0.00&#8243; two decimal digits, etc. A missing format means don&#8217;t show anything. So this format tells Excel to format positive and zero values as whole numbers, and don&#8217;t show anything else.</p>
<p>The primary (left) axis is a bit trickier, but we can use simple conditions to turn formats on and off. The format we need is &#8220;[&lt;=200]0;&#8221;. The expression in square brackets is the condition that sets the format. It says to display any number of value equal to or less than 200 as a whole number, and don&#8217;t display anything else. These conditions override the default positive-negative-zero sequence, but we can only apply two conditions, like &#8220;[one condition];[another condition];[all other numbers];[text]&#8220;.</p>
<p>Right click each axis and choose Format Axis. Select the Number tab of the dialog, click on Custom, and enter the appropriate format into the box (without the quotes). Don&#8217;t forget to click the Add button, or Excel will discard your carefully typed format.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols11.png" alt="Two Panel Column Chart, Axes Fixed" width="320" height="221" /></p>
<p>You can stretch the chart if you want more resolution in the Y values.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols12.png" alt="Two Panel Column Chart" width="282" height="306" /></p>
<p>It would have been easy enough to switch the panels. In the next chart, the primary Y axis is scaled from -200 to 200, and the number format is &#8221;0;;0;&#8221;. The secondary Y axis is scaled from 0 to 4000, and the number format is &#8221;[&lt;=2000]0;&#8221;.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://peltiertech.com/images/2012-02/twopanelcols13.png" alt="Two Panel Column Chart" width="282" height="306" /></p>
<p>In upcoming articles I&#8217;ll show this technique applied to line and horizontal bar charts, but it&#8217;s essentially the same protocol, so I&#8217;m sure you could figure it out easily.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/easy-two-panel-column-chart-in-excel/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Poor Man&#8217;s Sparklines in Microsoft Excel</title>
		<link>http://peltiertech.com/WordPress/poor-mans-sparklines-in-excel/</link>
		<comments>http://peltiertech.com/WordPress/poor-mans-sparklines-in-excel/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 08:00:18 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[sparklines]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3365</guid>
		<description><![CDATA[Microsoft introduced Sparklines as a native feature of Excel 2010. In a rare guest post, Sparklines For Excel vs. Excel 2010 Sparklines by Alex Kerin of Data Driven Consulting compared this new feature to existing third-party sparkline add-ins for Excel. In Sparklines and Data Bars in Excel 2010, I gave an introduction into how to use the new [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft introduced Sparklines as a native feature of Excel 2010. In a rare guest post, <a href="http://peltiertech.com/WordPress/sparklines-for-excel-vs-excel-2010-sparklines-guest-post/"class="vt-p" title="Sparklines For Excel vs. Excel 2010 Sparklines" >Sparklines For Excel vs. Excel 2010 Sparklines</a> by <strong>Alex Kerin</strong> of <a href="http://www.datadrivenconsulting.com/" rel="nofollow" class="vt-p" title="Data Driven: Data Analytics and Dashboard Design" >Data Driven Consulting</a> compared this new feature to existing third-party sparkline add-ins for Excel. In <a href="http://peltiertech.com/WordPress/sparklines-and-data-bars-in-excel-2010/"class="vt-p" title="Sparklines and Data Bars in Excel 2010" >Sparklines and Data Bars in Excel 2010</a>, I gave an introduction into how to use the new sparkline feature, demonstrated some of the options available for Excel 2010&#8242;s sparklines, and also showed how Excel 2010&#8242;s implementation of Data Bars was far superior to the original Data Bars in Excel 2007. I&#8217;ve also shown <a href="http://peltiertech.com/WordPress/how-to-make-horizontal-bullet-graphs-in-excel/"class="vt-p" title="How to Make Horizontal Bullet Graphs in Excel" >How to Make Horizontal Bullet Graphs</a> that can be fitted into the cells of a dashboard.</p>
<p>While it&#8217;s good to see sparklines as a native Excel feature, the Excel 2010 implementation is rudimentary, and third-party sparkline products have more functionality and more features than the native Excel sparklines. Yet it&#8217;s not necessary to deal with add-ins in order to realize expanded sparkline capabilities in Excel. Excel&#8217;s regular charts can be used to create decent sparklines, and this article will show you how.</p>
<h2>Native Excel 2010 Sparklines</h2>
<p>It&#8217;s easy enough to insert sparklines into an Excel 2010 worksheet. First, make sure you are not in &#8220;Compatibility Mode&#8221;. Compatibility Mode means the active workbook is as compatible as possible with Excel 2003; the most obvious feature is that the worksheet grid has the Excel 2003 numbers of rows and columns, not the expanded grid introduced in Excel 2007.</p>
<p>Select the data range or the location for the sparklines, and click one of the Sparklines buttons on the Insert tab. In this example, I selected the range where I wanted the sparklines to appear, then clicked the Column Sparkline button. The dialog shows the selected range in the Location Range edit box.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark001.png" alt="Create Sparklines Dialog" /></p>
<p><span id="more-3365"></span>Then I selected the data range, which appears in the Data Range edit box. For some reason, the Location Range edit box is cleared (and each box clears itself when the other box is edited), but Excel remembers the selected range.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark002.png" alt="Create Sparklines Dialog with Data Source Selected" /></p>
<p>Here are the sparklines with the location range still selected.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark003.png" alt="Built-In Sparklines in Excel 2010" /></p>
<p>Finally, here is the table with sparklines, with the active cell out of the way.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark004.png" alt="Built-In Sparklines in Excel 2010 (Clean)" /></p>
<h2>Create Sparklines From Regular Charts</h2>
<p>The protocol for generating your own sparklines using regular charts is presented below. This protocol works well in Excel 2010 and 2007. In earlier versions of Excel, charts have a border of several pixels around the plot area, so the chart area must be sized larger than the cell you want the sparkline displayed in. In earlier versions, there is also a limit to how much the chart can be shrunk and still show the entire plot area, so you&#8217;ll have to shrink the chart only partway, then shrink the plot area to a smaller fraction of the chart area size.</p>
<p>Keep in mind that while you can use regular charts for sparklines, the small size of a sparkline limits the amount of information you should try to cram into one. Leave out labels and limit yourself to about two series maximum in any given sparkline.</p>
<p>Start creating your sparkline by selecting the data for a single series.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark005.png" alt="Select Data for First Manual Sparkline" /></p>
<p>Insert a chart of the desired type. This is a typical Excel 2010 column chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark006.png" alt="Initial Appearance of Manual Sparkline" /></p>
<p>Now simplify formatting. Below left shows the chart with the chart area border removed and the chart and plot areas made transparent, so borders and cell fill colors show through. Below right, the legend and any axis and chart titles have been removed.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark007.png" alt="Remove Background and Borders, Remove Titles and Legend" /></p>
<p>The bars have been widened in the chart below left (by decreasing the gap width to 50%), and the major unit of the Y axis has been set to a small value, below right.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark008.png" alt="Fatten Up Bars (Reduce Gap Width), Shrink Major Y Unit" /></p>
<p>The axes have been hidden by selecting &#8220;None&#8221; for axis tick marks and axis tick labels and choosing &#8220;No line&#8221; for the axis line color. Note the size of the plot area within the chart.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark009.png" alt="Hide Axes and Note Plot Area Size" /></p>
<p>For best results, extend the plot area almost to the left and right edges of the chart, and stretch the bottom of the plot area to the bottom of the chart. Leave a large margin between the plot area and the top of the chart. In fact, you may have to increase this top margin in the sparkline, after the chart has been shrunk to fit a cell.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark010.png" alt="Resize Plot Area" /></p>
<p>Finally, shrink the chart and position it over the appropriate cell. If you hold down the Alt key while moving or resizing the chart, the chart edges will line up with the cell boundaries. If necessary, shrink the plot area from the top to increase the margin.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark011.png" alt="First Manual Sparkline Resized and Relocated" /></p>
<p>When all of the necessary formatting has been applied to the sparkline, and nothing else needs to be done, copy the sparkine and paste it into each of the other cells that need a sparkline. If you hold Ctrl and Alt while dragging the chart, a copy of the chart will be dragged into and aligned with the next cell.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark012.png" alt="Sparkline Copied and Pasted As Needed" /></p>
<p>All the charts are formatted identically. They also use the identical data, so let&#8217;s fix that.</p>
<p>Select the first sparkline. Notice how the source data is highlighted in the worksheet.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark013.png" alt="First Sparkline and Data Dange" /></p>
<p>Select the second sparkline. Notice how the highlighted data is from the first row. So is the highlighted data for the third sparkline.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark014.png" alt="Second Sparkline and First Data Range" /></p>
<p>You could change the source data by choosing Select Data from the Chart Tools &gt; Design tab, or from the right-click menu. You could also edit the chart series formula. But the easiest way to adjust the chart data is to drag the range highlight with the mouse. Move the mouse over the highlight until its border thickens, then drag it to the new range. If you&#8217;ve selected the plot area or chart area, both the series name and the Y value highlights move together. If you&#8217;ve selected the series itself, the series name and Y data must be changed separately.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark015.png" alt="Data Range for Second Sparkline Being Moved" /></p>
<p>Correct the third sparkline&#8217;s source data in the same way.</p>
<p>Here is the finished table with sparklines. Looks like the built-in sparklines.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark016.png" alt="Corrected Data Ranges for All Sparklines" /></p>
<p>You can use any chart type: here&#8217;s a line chart with markers.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark018.png" alt="Works With All Chart Types: Here Is a Line Chart" /></p>
<h2>Why Use Regular Charts?</h2>
<p>There are a number of reasons to use regular charts rather than the built-in Excel 2010 sparklines.</p>
<h2>Excel Version</h2>
<p>One obvious reason is that you might not have upgraded to Excel 2010. If you&#8217;re using Excel 2007, the techniques shown here work the same way.</p>
<p>In Excel 2003 and earlier, the chart imposes a thicker border between the plot area and the chart area, so you have to oversize the chart to make the plot area fit as intended. Also, in earlier versions, the plot area only shrinks a certain amount within the chart area, so further shrinking of the chart truncates the plot area. The chart area can only be shrunk so far, but the plot area can be reduced further without shrinking the chart. The result is a chart that&#8217;s substantially larger than the cell it covers, but making the plot and chart areas transparent makes this no problem.</p>
<h2>Mouseover Information</h2>
<p>An important feature of a regular chart that is lacking in a sparkline, is the ability to mouse over a point and read relevant information from a popup. This is very useful in an interactive dashboard.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark019.png" alt="Native Sparklines Have No Mouseover Popups" /></p>
<h2>Combination Charts</h2>
<p>What if you want to compare a time series to other data, such as a target value.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark020.png" alt="Combination Chart: Target and Actual" /></p>
<p>Native sparklines can only plot one timeline, while a regular chart has more flexibility (as do some of the third-party sparkline programs).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark021.png" alt="Combination Sparkline: Target and Actual" /></p>
<p>Remember the limited resolution of a cell-sized chart: adding the simple target data to these sparklines is almost not worth the effort.</p>
<h2>Other Embellishments</h2>
<p>You may wish to reverse the vertical axis. For example, your costs are probably reported as positive numbers, but you want to show them as negatives.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark022.png" alt="Reverse Y Axis So Positive Values Plot As Negative" /></p>
<p>Native sparklines do not support reversing the vertical axis, but regular charts do.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2012-01/spark017.png" alt="Sparkline With Reversed Y Axis" />
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/poor-mans-sparklines-in-excel/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Who&#8217;s to Blame for the Mess in Washington? Analysis of Chart Types</title>
		<link>http://peltiertech.com/WordPress/analysis-of-chart-types-whos-to-blame-for-the-mess-in-washington/</link>
		<comments>http://peltiertech.com/WordPress/analysis-of-chart-types-whos-to-blame-for-the-mess-in-washington/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 12:26:08 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Chart Types]]></category>
		<category><![CDATA[bar chart]]></category>
		<category><![CDATA[Pie Chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3334</guid>
		<description><![CDATA[In Republicans Blamed Most for Ineffective Government in U.S. Poll, Bloomberg show results of a poll that asked who was to blame for ineffective national government in Washington. Their results were shown in this donut chart: I was pointed to the Bloomberg article by Kevin Drum of Mother Jones, who wondered in Everybody Hates Everybody Else why [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.bloomberg.com/news/2011-09-15/republicans-get-most-blame-for-ineffective-governing-in-national-u-s-poll.html" rel="nofollow" title="Republicans Blamed Most for Ineffective Government in U.S. Poll" >Republicans Blamed Most for Ineffective Government in U.S. Poll</a>, Bloomberg show results of a poll that asked who was to blame for ineffective national government in Washington. Their results were shown in <a href="http://www.bloomberg.com/chart/iJD1OOQPCdSg/ " rel="nofollow" title="Who's to blame for what's wrong in Washington?" >this donut chart</a>:</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/WhosToBlame-BloombergDonut.png" alt="Who's to Blame - Bloomberg Donut Chart" /></p>
<p>I was pointed to the Bloomberg article by Kevin Drum of Mother Jones, who wondered in <a href="http://motherjones.com/kevin-drum/2011/09/everybody-hates-everybody-else " rel="nofollow" title="Everybody Hates Everybody Else" >Everybody Hates Everybody Else</a> why Bloomberg used a donut chart to plot the data, though he did not elaborate. We&#8217;ve been trained to cringe at pie and donut charts, and replace them with bar charts:</p>
<p><span id="more-3334"></span><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/WhosToBlame-Bar.png" alt="Who's to Blame - Bar Chart" /></p>
<p>Ah, we can breathe freely again. And we can see that people blame Obama slightly more than Congressional Democrats. This 1 percentage point difference was not apparent in the donut chart, and really it may be meaningless given the poll&#8217;s 3.3 percentage point margin of error. Of course, the Republicans have collected by far more blame than any other category. This is clear in both charts.</p>
<p>There is one reason to use a pie for this kind of data, though. Stephen Few himself described <em>The Secret Strength of Pies</em> in <a href="http://www.perceptualedge.com/articles/08-21-07.pdf " rel="nofollow" title="Save the Pies for Dessert" >Save the Pies for Dessert</a>. Pie charts have an advantage over simple bar charts when you want to compare not single values, but subtotals. What the donut chart above shows is that the total blame assigned to Democrats, the sum of Congressional Democrats and President Obama, is less than the blame assigned to Congressional Republicans.</p>
<p>The pie chart below shows this difference even more clearly: we have not cut out the central region of the pie, which has central angles as well as the areas of the points to help us decode the chart&#8217;s values.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/WhosToBlame-Pie.png" alt="Who's to Blame - Pie Chart" /></p>
<p>Sometimes this strength of pies is not realized, because data sorted differently may not have related slices in adjacent positions. However, if you know some categories are related (the two Democrat categories here), you can sort the data to make use of this feature of pie charts.</p>
<p>Then again, if you know some categories are related, you can convert the simple bar chart into a stacked bar chart, which sums related quantities linearly instead of circumferentially. This easier comparison allows us to see that Republican blame exceeds Democrat blame by almost twice the margin of error.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/WhosToBlame-StackedBar.png" alt="Who's to Blame - Stacked Bar Chart" /></p>
<p>Bloomberg&#8217;s choice of chart type may not have been as bad as our initial reaction indicates, assuming the data was purposely sorted the way it was. Our stacked bar chart is an even better choice.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/analysis-of-chart-types-whos-to-blame-for-the-mess-in-washington/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

