<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>PTS Blog</title>
	
	<link>http://peltiertech.com/WordPress</link>
	<description>PTS Charts and Stuff</description>
	<pubDate>Thu, 24 Jul 2008 14:55:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><image><link>http://peltiertech.com/WordPress/</link><url>http://peltiertech.com/WordPress/wp-content/PTSlogoSmall.png</url><title>Peltier Technical Services, Inc.</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/peltiertech/EsrO" type="application/rss+xml" /><item>
		<title>Order of Points in XY and Line Charts</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/344676915/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/24/order-of-points-in-xy-and-line-charts/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 14:55:51 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Axes]]></category>

		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Combination Charts]]></category>

		<category><![CDATA[VBA]]></category>

		<category><![CDATA[line chart]]></category>

		<category><![CDATA[xy chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=122</guid>
		<description>There has been a lot of discussion here lately about XY and Line charts:

Line Charts vs. XY Charts
Line-XY Combination Charts
Category Axis Tricks for Line and Area Charts - 1
Category Axis Tricks for Line and Area Charts - 2

One interesting thing about a line chart with a date scale X axis is the order of the [...]</description>
			<content:encoded><![CDATA[<p>There has been a lot of discussion here lately about XY and Line charts:</p>
<ul style="margin-left : 30px">
<li><a class="simple_alink" title="Line Charts vs. XY Charts" href="http://peltiertech.com/WordPress/2008/07/10/line-charts-vs-xy-charts/">Line Charts vs. XY Charts</a></li>
<li><a class="simple_alink" title="Line-XY Combination Charts" href="http://peltiertech.com/WordPress/2008/06/26/line-xy-combination-charts/">Line-XY Combination Charts</a></li>
<li><a title="Category Axis Tricks for Line and Area Charts - 1" href="http://peltiertech.com/WordPress/2008/06/06/category-axis-tricks-for-line-and-area-charts-1/">Category Axis Tricks for Line and Area Charts - 1</a></li>
<li><a title="Category Axis Tricks for Line and Area Charts - 2" href="http://peltiertech.com/WordPress/2008/06/08/category-axis-tricks-for-line-and-area-charts-2/">Category Axis Tricks for Line and Area Charts - 2</a></li>
</ul>
<p>One interesting thing about a line chart with a date scale X axis is the order of the plotted points. Consider a data set like this, in which the points are out of chronological order.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200807/DataOrder.png" alt="" /></p>
<p>The line chart internally sorts the data by date, and connects the points in this order, while the XY chart connects them in the order they appear in the sheet.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200807/LineOrder.png" alt="" /> <img src="http://peltiertech.com/WordPress/wp-content/img200807/XYOrder.png" alt="" /></p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200807/LineXYOrder.png" alt="" /></p>
<p>Here are the same charts as above, with labels on each point indicating the order of each point. Points 1 and 3 of each point are the same, but the other points have different index values depending on the chart type, because the points were out of date order in the worksheet.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200807/LineOrderLabel.png" alt="" /> <img src="http://peltiertech.com/WordPress/wp-content/img200807/XYOrderLabel.png" alt="" /></p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200807/LineXYOrderLabel.png" alt="" /></p>
<p>I used the following simple procedure to number the points in a series. Select a series, then press Alt-F to pop up the macros dialog (or access the dialog through Tools menu &gt; Macros). Select the macro name from the list, and press run.</p>
<pre class="vba">Sub NumberThePointsInASeries()
  Dim iPt As Long
  If TypeName(Selection) = "Series" Then
    For iPt = 1 To Selection.Points.Count
      With Selection.Points(iPt)
        On Error Resume Next
        .HasDataLabel = True
        .DataLabel.Characters.Text = CStr(iPt)
        On Error GoTo 0
      End With
    Next
  Else
    MsgBox "Select a series and try again.", vbExclamation
  End If
End Sub</pre>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=8zLM19"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=8zLM19" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=Z5t9PJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=Z5t9PJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/344676915" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/24/order-of-points-in-xy-and-line-charts/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F24%2Forder-of-points-in-xy-and-line-charts%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/24/order-of-points-in-xy-and-line-charts/</feedburner:origLink></item>
		<item>
		<title>In-Cell Bullet Charts</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/343781473/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/23/in-cell-bullet-charts/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 18:05:45 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Formatting]]></category>

		<category><![CDATA[bullet chart]]></category>

		<category><![CDATA[in-cell chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=171</guid>
		<description>Stephen Few of Perceptual Edge introduced the concept of Bullet Graphs a few years ago, and their use as a replacement for various gauge charts is slowly expanding. Bullet graphs are easier to read than the many gauges that adorn poorly designed business dashboards, while taking up less space and breaking the ineffective metaphor of [...]</description>
			<content:encoded><![CDATA[<p><a title="Perceptual Edge" href="http://perceptualedge.com/">Stephen Few</a> of Perceptual Edge introduced the concept of <a title="Bullet Graph Design Spec (pdf)" href="http://www.perceptualedge.com/articles/misc/Bullet_Graph_Design_Spec.pdf">Bullet</a> <a title="Bullet Graphs for Not-to-Exceed Targets" href="http://www.perceptualedge.com/blog/?p=217">Graphs</a> a few years ago, and their use as a replacement for various gauge charts is slowly expanding. Bullet graphs are easier to read than the many gauges that adorn poorly designed business dashboards, while taking up less space and breaking the ineffective metaphor of a business dashboard as the cockpit of a 747.</p>
<p align="center"><img title="Stephen Few's Bullet Charts" src="http://peltiertech.com/WordPress/wp-content/img200807/sfew-bullets.png" alt="Stephen Few's Bullet Charts" /></p>
<p><strong>Charley Kyd</strong> of <a href="http://exceluser.com/">Excel User</a> shows <a title="How to Create Bullet Graphs To Replace Gauges in Excel" href="http://www.exceluser.com/explore/bullet.htm">How to Create Bullet Graphs To Replace Gauges in Excel</a>.</p>
<p align="center"><img title="Excel User's Excel Bullets" src="http://peltiertech.com/WordPress/wp-content/img200807/ckyd-bullet03.gif" alt="Excel User's Excel Bullets" width="464" height="66" /></p>
<p><a href="http://dealerdiagnostics.com/">Dealer Diagnostics</a> shows how to <a href="http://dealerdiagnostics.com/blog/2008/05/create-bullet-graphs-with-google-charts-in-7-easy-steps/">Create Bullet Graphs with Google Charts</a>.</p>
<p align="center"><img title="Google Bullet Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/google-bullet-chart.png" alt="Google Bullet Chart" width="100" height="40" /> <img title="Google Bullet Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/google-bullet-chart2.png" alt="Google Bullet Chart" width="100" height="40" /></p>
<p>And now <strong>Chandoo</strong> of <a title="Pointy Haired Dilbert" href="http://chandoo.org/wp/">Pointy Haired Dilbert</a> wants to help you <a href="http://chandoo.org/wp/2008/07/21/dashboard-bullet-graphs-excel/">Become a Dashboard Ninja with Bullet Graphs</a>. Chandoo has done some interesting things with conditional formatting (visit his blog for examples), which he uses for the background colors of his bullets, shown below. The bars and the ticks used to indicate last year&#8217;s performance are controlled by worksheet formulas.</p>
<p align="center"><img title="Chandoo's In-Cell Excel Bullets" src="http://peltiertech.com/WordPress/wp-content/img200807/chandoo-bullet-bwgray.png" alt="Chandoo's In-Cell Excel Bullets" width="663" height="229" /></p>
<p align="center"><img title="Chandoo's In-Cell Excel Bullets" src="http://peltiertech.com/WordPress/wp-content/img200807/chandoo-bullet-color.png" alt="Chandoo's In-Cell Excel Bullets" width="663" height="229" /></p>
<p>This is a clever way to get bullet charts into an Excel report.</p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=g5QtRk"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=g5QtRk" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=dBC0oJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=dBC0oJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/343781473" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/23/in-cell-bullet-charts/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F23%2Fin-cell-bullet-charts%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/23/in-cell-bullet-charts/</feedburner:origLink></item>
		<item>
		<title>Easier Interactive Multiple Line Chart</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/343123172/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/22/easier-interactive-multiple-line-chart/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 02:37:44 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Data Techniques]]></category>

		<category><![CDATA[Dynamic Charts]]></category>

		<category><![CDATA[Interactive]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=163</guid>
		<description>In Interactive Multiple Line Chart I showed how to make an interactive chart that allows the user to select from among a number of series using a listbox, and the selected series is displayed in a chart.

A similar technique is described in Interactive Parallel Coordinates Chart on my web site, and I used this technique [...]</description>
			<content:encoded><![CDATA[<p>In <a class="simple_alink" title="Interactive Multiple Line Chart" href="http://peltiertech.com/WordPress/2008/07/22/interactive-multiple-line-chart/">Interactive Multiple Line Chart</a> I showed how to make an interactive chart that allows the user to select from among a number of series using a listbox, and the selected series is displayed in a chart.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive06a.png" alt="Line Chart and Listbox with Highlighted Series A" width="515" height="255" /></p>
<p>A similar technique is described in <a href="http://peltiertech.com/Excel/Charts/ParallelCoord.html">Interactive Parallel Coordinates Chart</a> on my web site, and I used this technique in a workbook that supports my blog post <a class="simple_alink" title="Re: Abortion Ratios 1980-2003" href="http://peltiertech.com/WordPress/2008/07/21/re-abortion-ratios-1980-2003/">Re: Abortion Ratios 1980-2003</a>.</p>
<p>My colleague <a title="Modeling in Excel" href="http://www.westnet.net.au/balson/ModellingExcel/">Dermot Balson</a> read the post and wondered why I was doing it the hard way. Well, he&#8217;s right. I built a set of dynamic names that change based on the listbox selection, which is certainly a valid approach. However, for something as &#8220;simple&#8221; as plotting a column or row of data, it&#8217;s overkill. In this post I will describe an easier approach.</p>
<p><strong>Data by Columns</strong></p>
<p>The worksheet has data for multiple companies in columns, with each row representing the respective values on a given date. I made up some sine functions for the company data; a portion of the data is shown below.</p>
<p align="center"><img title="Portion of Data Range" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive09.png" alt="Portion of Data Range" width="364" height="256" /></p>
<p>For many situations a popular visualization approach is to plot one series in a contrasting color, and the rest of the data set is plotted in the background. I plotted this data on a single chart, and formatted all series to use a light gray line. This chart comprises the background.</p>
<p align="center"><img title="Line Chart with 12 Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive01.png" alt="Line Chart with 12 Series" width="400" height="254" /></p>
<p>We need to define a couple names to make this work. First, the column headers, the range of cells containing the Company names, is named &#8220;Companies&#8221;.</p>
<p>The listbox we will add requires a columnar (vertical) list, and the company names are in a horizontal list. I selected a range one column wide and 12 rows high (there are 12 companies in the table), typed this formula</p>
<pre class="vba">=TRANSPOSE(Companies)
 </pre>
<p>and held down CTRL+SHIFT while pressing ENTER to make it an array formula. When an array formula is correctly entered, Excel wraps it in curly braces:</p>
<pre class="vba">{=TRANSPOSE(Companies)}
 </pre>
<p>I named this range &#8220;CompanyList&#8221;, then selected another nearby cell (cell O2 in the shot below) and named it &#8220;SelectedItem&#8221;.</p>
<p align="center"><img title="Defined Range Names" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive02.png" alt="Defined Range Names" width="167" height="273" /></p>
<p>I added a listbox from the forms menu to the worksheet, and formatted it to use CompanyList as the input range and SelectedItem as the cell link. This means the list in CompanyList is displayed in the listbox, and the index of the selected item is displayed in Selecteditem.</p>
<p align="center"><img title="Format Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive08.png" alt="Format Listbox" width="417" height="414" /></p>
<p>The listbox looks like this:</p>
<p align="center"><img title="Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive03.png" alt="Listbox" width="111" height="239" /></p>
<p>A column adjacent to the data range is used to hold the data for the selected company. Here is a pilot&#8217;s eye view of the worksheet (for a better view, download the workbook from the link at the bottom of the page).</p>
<p align="center"><img title="Worksheet" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive20.png" alt="Worksheet" width="558" height="525" /></p>
<p>The original data is in A23:M79, and the added data, highlighted in blue, is in N23:N79. Cell N23 has this formula:</p>
<pre class="vba">=OFFSET(A23,0,SelectedItem)
 </pre>
<p>and the formula is filled down to N7.</p>
<p>Now the selected series can be added to the chart. Copy the blue range, select the chart, and use Edit menu &gt; Paste Special to add the data to the chart as a new series. Format to suit.</p>
<p>To create a chart without the background series (like the one shown at the top of this post), simply make the chart using column N for the Y values and column A for the X values.</p>
<p>Here is the chart, showing all series in the background gray and the selected Company A highlighted in blue.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive06.png" alt="Line Chart and Listbox with Highlighted Series A" width="515" height="255" /></p>
<p>Clicking another item in the list changes the highlighted series, to Company L below.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series L" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive07.png" alt="Line Chart and Listbox with Highlighted Series L" width="515" height="255" /></p>
<p><strong>By Row</strong></p>
<p>For this example I made up data for multiple companies in rows, with each column representing the respective values on a given date; a portion of the data is shown below.</p>
<p align="center"><img title="Portion of Data Range" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive10.png" alt="Portion of Data Range" width="397" height="222" /></p>
<p>I plotted this data on a single chart, and formatted all series to use a light gray line. This chart comprises the background.</p>
<p align="center"><img title="Line Chart with 12 Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive12.png" alt="Line Chart with 12 Series" width="400" height="254" /></p>
<p>We need to define a couple names to make this work. First, the row headers, the range of cells containing the Company names, is named “TheCompanies”. I selected another nearby cell and named it “TheSelection”. (The names are different than in the first example, because both examples are in the same workbook, and I wanted to avoid naming conflicts.)</p>
<p>I added a listbox from the forms menu to the worksheet, and formatted it to use TheCompanies as the input range and TheSelection as the cell link. This means the list in TheCompanies is displayed in the listbox, and the index of the selected item is displayed in TheSelection.</p>
<p align="center"><img title="Format Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive11.png" alt="Format Listbox" width="417" height="414" /></p>
<p>The listbox looks like this:</p>
<p align="center"><img title="Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive03.png" alt="Listbox" width="111" height="239" /></p>
<p>A row adjacent to the data range is used to hold the data for the selected company. Here is a pilot&#8217;s eye view of the worksheet (for a better view, download the workbook from the link at the bottom of the page).</p>
<p align="center"><img title="Worksheet" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive21.png" alt="Worksheet" width="475" height="138" /></p>
<p>The original data is in A23:M35, and the added data, highlighted in orange, is in A36:M36. Cell A36 has this formula:</p>
<pre class="vba">=OFFSET(A23,TheSelection,0)
 </pre>
<p>and the formula is filled right to M36.</p>
<p>Now the selected series can be added to the chart. Copy the orange range, select the chart, and use Edit menu &gt; Paste Special to add the data to the chart as a new series. Format to suit.</p>
<p>To create a chart without the background series (like the one shown at the top of this post), simply make the chart using row 36 for the Y values and row 23 for the X values.</p>
<p>Here is the chart, showing all series in the background gray and the selected Company A highlighted in orange.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive14.png" alt="Line Chart and Listbox with Highlighted Series A" width="523" height="255" /></p>
<p>Clicking another item in the list changes the highlighted series, to Company L below.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series L" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive15.png" alt="Line Chart and Listbox with Highlighted Series L" width="523" height="255" /></p>
<p><strong>Sample Workbook</strong></p>
<p>Download a workbook that contains these two examples: <a href="http://peltiertech.com/WordPress/wp-content/img200807/EasierInteractiveLines.zip">EasierInteractiveLines.zip</a></p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=Jb5h6M"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=Jb5h6M" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=E9i7rJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=E9i7rJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/343123172" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/22/easier-interactive-multiple-line-chart/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F22%2Feasier-interactive-multiple-line-chart%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/22/easier-interactive-multiple-line-chart/</feedburner:origLink></item>
		<item>
		<title>Interactive Multiple Line Chart</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/342216060/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/22/interactive-multiple-line-chart/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 04:46:20 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Data Techniques]]></category>

		<category><![CDATA[Dynamic Charts]]></category>

		<category><![CDATA[Interactive]]></category>

		<category><![CDATA[dynamic range]]></category>

		<category><![CDATA[names]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=158</guid>
		<description>In the Microsoft charting newsgroup, SKP asked how to make a chart that he could easily change from one series to another. This post will detail the steps to make an interactive chart that allows the user to select from among a number of series using a listbox, and the selected series is displayed in [...]</description>
			<content:encoded><![CDATA[<p>In the Microsoft charting newsgroup, SKP asked how to make a chart that he could easily change from one series to another. This post will detail the steps to make an interactive chart that allows the user to select from among a number of series using a listbox, and the selected series is displayed in a chart.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive06a.png" alt="Line Chart and Listbox with Highlighted Series A" width="515" height="255" /></p>
<p>A similar technique is described in <a href="http://peltiertech.com/Excel/Charts/ParallelCoord.html">Interactive Parallel Coordinates Chart</a> on my web site, and I used this technique in a workbook that supports my blog post <a class="simple_alink" title="Re: Abortion Ratios 1980-2003" href="http://peltiertech.com/WordPress/2008/07/21/re-abortion-ratios-1980-2003/">Re: Abortion Ratios 1980-2003</a>.</p>
<blockquote><p><strong>Update (22 July 2008)</strong></p>
<p>My colleague <a title="Modeling in Excel" href="http://www.westnet.net.au/balson/ModellingExcel/">Dermot Balson</a> read this post and wondered why I was doing it the hard way. Well, he’s right. I&#8217;ve built a set of dynamic names that change based on the listbox selection, which is certainly a valid approach. However, for something as “simple” as plotting a column or row of data, it’s overkill. In&nbsp;<a href="http://peltiertech.com/WordPress/2008/07/22/easier-interactive-multiple-line-chart/">Easier Interactive Multiple Line Chart</a> I describe an easier approach.</p>
</blockquote>
<p><strong>Data by Columns</strong></p>
<p>SKP had data for multiple companies in columns, with each row representing the respective values on a given date. I made up some sine functions for the company data; a portion of the data is shown below.</p>
<p align="center"><img title="Portion of Data Range" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive09.png" alt="Portion of Data Range" width="364" height="256" /></p>
<p>For many situations a popular visualization approach is to plot one series in a contrasting color, and the rest of the data set is plotted in the background. I plotted this data on a single chart, and formatted all series to use a light gray line. This chart comprises the background.</p>
<p align="center"><img title="Line Chart with 12 Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive01.png" alt="Line Chart with 12 Series" width="400" height="254" /></p>
<p>We need to define some dynamic names to make this work. This process is covered in some detail in <a class="simple_alink" title="Dynamic Charts" href="../2008/05/14/dynamic-charts/">Dynamic Charts</a>. First, the column headers, the range of cells containing the Company names, is named &#8220;Companies&#8221;. The first column, the range of cells containing the dates, is named &#8220;Dates&#8221;.</p>
<p>The listbox we will add requires a columnar (vertical) list, and the company names are in a horizontal list. I selected a range one column wide and 12 rows high (there are 12 companies in the table), typed this formula</p>
<pre class="vba">=TRANSPOSE(Companies)
 </pre>
<p>and held down CTRL+SHIFT while pressing ENTER to make it an array formula. When an array formula is correctly entered, Excel wraps it in curly braces:</p>
<pre class="vba">{=TRANSPOSE(Companies)}
 </pre>
<p>I named this range &#8220;CompanyList&#8221;, then selected another nearby cell (cell O2 in the shot below) and named it &#8220;SelectedItem&#8221;.</p>
<p align="center"><img title="Defined Range Names" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive02.png" alt="Defined Range Names" width="167" height="273" /></p>
<p>I added a listbox from the forms menu to the worksheet, and formatted it to use CompanyList as the input range and SelectedItem as the cell link. This means the list in CompanyList is displayed in the listbox, and the index of the selected item is displayed in Selecteditem.</p>
<p align="center"><img title="Format Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive08.png" alt="Format Listbox" width="417" height="414" /></p>
<p>The listbox looks like this:</p>
<p align="center"><img title="Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive03.png" alt="Listbox" width="111" height="239" /></p>
<p>A couple more names must be defined. Open the Defined Name dialog, add the name &#8220;SelectedSeries&#8221;, enter the following Refers To formula, and click Add.</p>
<pre class="vba">=OFFSET(Dates,0,SelectedItem)
 </pre>
<p>Add the name &#8220;SelectedName&#8221;, enter the following Refers To formula, and click Done.</p>
<pre class="vba">=OFFSET(Dates,-1,SelectedItem,1,1)
 </pre>
<p>Now the selected series can be added to the chart. Select the chart, go to the Chart menu, choose Source data, and click on the Series tab. Click Add, then enter the appropriate names for the series name, values, and category labels, prefixed with the sheet name. Click OK.</p>
<p align="center"><img title="Add Selected Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive04.png" alt="Add Selected Series" width="414" height="469" /></p>
<p>To create a chart without the background series (like the one shown at the top of this post), select an empty cell, run the chart wizard, and in Step 2, click on the Series tab, add the first series, and enter the range names as above.</p>
<p>Here is the chart, showing all series in the background gray and the selected Company A highlighted in blue.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive06.png" alt="Line Chart and Listbox with Highlighted Series A" width="515" height="255" /></p>
<p>Clicking another item in the list changes the highlighted series, to Company L below.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series L" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive07.png" alt="Line Chart and Listbox with Highlighted Series L" width="515" height="255" /></p>
<p><strong>By Row</strong></p>
<p>For this example I made up data for multiple companies in rows, with each column representing the respective values on a given date; a portion of the data is shown below.</p>
<p align="center"><img title="Portion of Data Range" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive10.png" alt="Portion of Data Range" width="397" height="222" /></p>
<p>I plotted this data on a single chart, and formatted all series to use a light gray line. This chart comprises the background.</p>
<p align="center"><img title="Line Chart with 12 Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive12.png" alt="Line Chart with 12 Series" width="400" height="254" /></p>
<p>We need to define some dynamic names to make this work, as described in <a class="simple_alink" title="Dynamic Charts" href="http://peltiertech.com/WordPress/2008/05/14/dynamic-charts/">Dynamic Charts</a>. First, the row headers, the range of cells containing the Company names, is named “TheCompanies”. The first row, the range of cells containing the dates, is named “TheDates”. I selected another nearby cell and named it “TheSelection”. (The names are different than in the first example, because both examples are in the same workbook, and I wanted to avoid naming conflicts.)</p>
<p>I added a listbox from the forms menu to the worksheet, and formatted it to use TheCompanies as the input range and TheSelection as the cell link. This means the list in TheCompanies is displayed in the listbox, and the index of the selected item is displayed in TheSelection.</p>
<p align="center"><img title="Format Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive11.png" alt="Format Listbox" width="417" height="414" /></p>
<p>The listbox looks like this:</p>
<p align="center"><img title="Listbox" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive03.png" alt="Listbox" width="111" height="239" /></p>
<p>A couple more names must be defined. Open the Defined Name dialog, add the name &#8220;TheSeries&#8221;, enter the following Refers To formula, and click Add.</p>
<pre class="vba">=OFFSET(TheDates,TheSelection,0)
 </pre>
<p>Add the name “TheName”, enter the following Refers To formula, and click Done.</p>
<pre class="vba">=OFFSET(TheDates,TheSelection,-1,1,1)
 </pre>
<p>Now the selected series can be added to the chart. Select the chart, go to the Chart menu, choose Source data, and click on the Series tab. Click Add, then enter the appropriate names for the series name, values, and category labels, prefixed with the sheet name. Click OK.</p>
<p align="center"><img title="Add Selected Series" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive13.png" alt="Add Selected Series" width="414" height="469" /></p>
<p>To create a chart without the background series (like the one shown at the top of this post), select an empty cell, run the chart wizard, and in Step 2, click on the Series tab, add the first series, and enter the range names as above.</p>
<p>Here is the chart, showing all series in the background gray and the selected Company A highlighted in orange.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series A" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive14.png" alt="Line Chart and Listbox with Highlighted Series A" width="523" height="255" /></p>
<p>Clicking another item in the list changes the highlighted series, to Company L below.</p>
<p align="center"><img title="Line Chart and Listbox with Highlighted Series L" src="http://peltiertech.com/WordPress/wp-content/img200807/Interactive15.png" alt="Line Chart and Listbox with Highlighted Series L" width="523" height="255" /></p>
<p><strong>Sample Workbook</strong></p>
<p>Download a workbook that contains these two examples: <a href="http://peltiertech.com/WordPress/wp-content/img200807/InteractiveLines.zip">InteractiveLines.zip</a></p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=WKi7fX"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=WKi7fX" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=dKcr6J"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=dKcr6J" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/342216060" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/22/interactive-multiple-line-chart/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F22%2Finteractive-multiple-line-chart%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/22/interactive-multiple-line-chart/</feedburner:origLink></item>
		<item>
		<title>Re: Abortion Ratios 1980-2003</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/341869568/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/21/re-abortion-ratios-1980-2003/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 20:36:30 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Dynamic Charts]]></category>

		<category><![CDATA[Interactive]]></category>

		<category><![CDATA[controls]]></category>

		<category><![CDATA[dynamic range]]></category>

		<category><![CDATA[names]]></category>

		<category><![CDATA[panel chart]]></category>

		<category><![CDATA[small multiples]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=157</guid>
		<description>In Chart Design: Abortion Ratios 1980-2003 Jorge Camoes shows a nice panel chart of Abortion Ratios vs. Year (1980-2003) for different age groups, taking US Census Bureau data. I reproduce a few panels of Jorge&amp;#8217;s chart below; click on the chart to see his entire panel chart.

Jorge points out the downward trend in the curves [...]</description>
			<content:encoded><![CDATA[<p>In <a href="http://charts.jorgecamoes.com/chart-design-abortion-ratios-1980-2003/">Chart Design: Abortion Ratios 1980-2003</a> Jorge Camoes shows a nice panel chart of Abortion Ratios vs. Year (1980-2003) for different age groups, taking <a href="http://www.census.gov/compendia/statab/tables/08s0097.xls">US Census Bureau data</a>. I reproduce a few panels of Jorge&#8217;s chart below; click on the chart to see his entire panel chart.</p>
<p align="center"><a title="Jorge Camoes Panel Chart" href="http://peltiertech.com/WordPress/wp-content/img200807/abortion-ratios-jorge.png"><img title="Section of Jorge Camoes' Panel Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/abortion-ratios-jorge-clip.png" alt="Section of Jorge Camoes' Panel Chart" width="460" height="240" /></a></p>
<p>Jorge points out the downward trend in the curves from 1980 to 2003, which are evident in all seven age groups in the full panel chart (the &#8220;&lt;15&#8243; age group actually has started to increase again after about 1995). What is less obvious is a downward trend from the &#8220;&lt;15&#8243; through &#8220;30-34&#8243; age groups, which then rises again from &#8220;30-34&#8243; through &#8220;&gt;40&#8243;. Jorge cautions against missing such patterns when planning a display such as this.<span id="more-157"></span></p>
<p>The first step to constructing an analysis like Jorge has made, is to examine the data from as many directions as possible. When you have rows and columns of data, the first exploratory charts you must make show the data plotted with series in rows and with series in columns. I made two charts of this sort, not separated yet as a comprehensive panel chart would be. The first chart below shows the data as Jorge has plotted it; the second shows the same data plotted orthogonally.</p>
<p align="center"><img title="Abortion Rate vs. Year by Age" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionRate_Year_Age.png" alt="Abortion Rate vs. Year by Age" width="525" height="315" /><br />
 <img title="Abortion Rate vs. Age by Year" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionRate_Age_Year.png" alt="Abortion Rate vs. Age by Year" width="522" height="315" /></p>
<p>The first chart shows the downward trend Jorge chose to emphasize; the second chart shows the &#8220;U&#8221; shaped pattern Jorge warns us not to miss. There is no &#8220;best way&#8221; to show all of this information on a chart. Sometimes the solution is to use more than one chart.</p>
<p>One way to make this easier depends on the ability to provide an interactive chart. In Excel this can be done using worksheet controls that redefine dynamic ranges as they are adjusted by the user. I used this approach on my web site to describe an <a href="../../Excel/Charts/ParallelCoord.html">Interactive Parallel Coordinates Chart</a>. For this exercise, I created an interactive version of each of the charts above in a <a title="Abortion Rates Interactive Charts" href="http://peltiertech.com/WordPress/wp-content/img200807/AbortionRates.zip">downloadable zipped workbook</a>. One of these charts is shown below. All series are shown in light gray to provide context, while the series selected in the listbox is shown in a distinct color.</p>
<p align="center"><img title="Interactive chart of Abortion Rate vs. Year by Age" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionRate_Year_DynoAge.png" alt="Interactive chart of Abortion Rate vs. Year by Age" width="460" height="418" /></p>
<p>Jorge also points out that while the Abortion Rate is highest for the youngest age group, the percentage of abortions by age group is lowest for this age group. Another pair of charts displays this behavior; I will show these below, and suspend my analysis. Jorge has added this data to his panel chart using a thin bar beside each panel. Alternatively, an additional chart adjacent to the first may be used to show this data.</p>
<p align="center"><img title="Abortion Percentage vs. Year by Age" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionPctg_Year_Age.png" alt="Abortion Percentage vs. Year by Age" width="525" height="315" /><br />
 <img title="Abortion Percentage vs. Age by Year" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionPctg_Age_Year.png" alt="Abortion Percentage vs. Age by Year" width="522" height="315" /></p>
<p>Some brainstorming could help identify reasons for the observed behavior. For example, the &#8220;&lt;15&#8243; age group has the fewest pregnancies, and most of these are terminated by abortions.</p>
<p>In <a href="http://blog.xlcubed.com/small-mutiples-abortion-data-1980-2003/">Small Multiples - Abortion Data 1980-2003</a>, Andreas Lipphardt has written about Jorge&#8217;s panel chart. Andreas likes the panel (small multiples) chart, but feels that it can be improved. He would leave off the light gray lines showing data from other panels (I actually like them, but Andreas is right, they really aren&#8217;t necessary here). Andreas would replace the bars showing the percentage of total abortions by age group (between the panels in Jorge&#8217;s plot) and replace them with another row of panels, showing how this data trends with time (Jorge had used a single time point, I believe the last year of the study). Andreas&#8217; added panel corresponds to the first chart of my second pair, above. Following Andreas&#8217; adjustments to Jorge&#8217;s chart, it may not be a bad design to include several rows in the panel chart. Here is a first cut, with absolutely minimal labeling.</p>
<p align="center"><img title="Abortion Rate Statistics by Age" src="http://peltiertech.com/WordPress/wp-content/img200807/AbortionPanel.png" alt="Abortion Rate Statistics by Age" width="587" height="268" /></p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=TYhmLf"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=TYhmLf" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=erfRVJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=erfRVJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/341869568" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/21/re-abortion-ratios-1980-2003/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F21%2Fre-abortion-ratios-1980-2003%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/21/re-abortion-ratios-1980-2003/</feedburner:origLink></item>
		<item>
		<title>Excel Category Axis Types</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/341530348/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/21/excel-category-axis-types/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 13:15:38 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Axes]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Formatting]]></category>

		<category><![CDATA[line chart]]></category>

		<category><![CDATA[xy chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=156</guid>
		<description>In Line Charts vs. XY Charts I described the difference between these two Excel chart types. There is no difference in the ways you can format the series, so perhaps the names of the chart types are confusing. The differences are in the ways their respective X axes treat the X data. I discussed the [...]</description>
			<content:encoded><![CDATA[<p>In <a title="Line Charts vs. XY Charts" href="http://peltiertech.com/WordPress/2008/07/10/line-charts-vs-xy-charts/">Line Charts vs. XY Charts</a> I described the difference between these two Excel chart types. There is no difference in the ways you can format the series, so perhaps the names of the chart types are confusing. The differences are in the ways their respective X axes treat the X data. I discussed the differences in that post, and in <a title="Line-XY Combination Charts" href="http://peltiertech.com/WordPress/2008/07/10/2008/06/26/line-xy-combination-charts/">Line-XY Combination Charts</a> I showed how to make a combination Line-XY chart that combines the nice date formatting of a Line chart&#8217;s date scale axis with the more flexible plotting that an XY chart allows along the X axis.</p>
<p>In this post I will illustrate the behavior of the different category types in more detail.<span id="more-156"></span></p>
<p><em><strong>Categorical Data</strong></em></p>
<p>The following data has a column of category labels for X and a column of numerical values for Y.</p>
<p align="center"><img title="Categorical X data" src="http://peltiertech.com/WordPress/wp-content/img200807/DataCats.png" alt="Categorical X data" width="155" height="137" /></p>
<p>The default Line and Column charts are shown below. The categories are completely visible in the chart, because the value (Y) axis is set to cross the category (X) axis between categories, the default setting for line and column charts.</p>
<p align="center"><img title="Line Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineCat1.png" alt="Line Chart - Categorical X Axis" width="192" height="136" /> <img title="Column Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColCat1.png" alt="Column Chart - Categorical X Axis" width="192" height="136" /></p>
<p>Below, the value (Y) axis is set <em>not</em> to cross the category (X) axis between categories, so the first and last categories are only halfway visible.</p>
<p align="center"><img title="Line Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineCat2.png" alt="Line Chart - Categorical X Axis" width="192" height="136" /> <img title="Column Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColCat2.png" alt="Column Chart - Categorical X Axis" width="192" height="136" /></p>
<p>The default Area chart is shown below left. Unlike the Line and Column charts, its default is for the value (Y) axis <em>not</em> to cross the category (X) axis between categories. When the value (Y) axis is set to cross the category (X) axis between categories, there is a gap between the edges of the filled area and the edges of the chart (below right).</p>
<p align="center"><img title="Area Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/AreaCat1.png" alt="Area Chart - Categorical X Axis" width="192" height="136" /> <img title="Area Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/AreaCat2.png" alt="Area Chart - Categorical X Axis" width="192" height="136" /></p>
<p>A default bar chart has its category (X) axis along the vertical axis, and the bars extend horizontally parallel to the value (Y) axis. Note that the vertical axis is the X axis and the horizontal axis is the Y axis, unlike the convention in most charts. This is a common confusion for newcomers to Excel&#8217;s charts.</p>
<p align="center"><img title="Bar Chart - Categorical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/BarCat.png" alt="Bar Chart - Categorical X Axis" width="192" height="136" /></p>
<p>Here is an XY chart made using text labels for its X values. An XY chart has a value-based X axis, like its Y axis. Excel cannot plot nonnumerical data in a chart, so instead of the text labels, Excel inserts counting numbers, 1 for the first label, 2 for the second, etc. Nonnumerical values used for Y values in any chart are treated as zeros.</p>
<p align="center"><img title="XY Chart - Value X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYCat.png" alt="XY Chart - Value X Axis" width="192" height="136" /></p>
<p><em><strong>Numerical Data</strong></em></p>
<p>The following data has a column of numerical values for X and a column of numerical values for Y.</p>
<p align="center"><img title="Numerical X data" src="http://peltiertech.com/WordPress/wp-content/img200807/DataNumbers.png" alt="Numerical X data" width="155" height="137" /></p>
<p>Here are default Line and Column charts made using numerical values for their X values. The category (X) axis treats the X values as labels, despite their numerical character, so along the X axis points are spaced equally, not spaced according to the numerical values.</p>
<p align="center"><img title="Line Chart - Numerical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineNumbers.png" alt="Line Chart - Numerical X Axis" width="192" height="136" /> <img title="Column Chart - Numerical X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColNumbers.png" alt="Column Chart - Numerical X Axis" width="192" height="136" /></p>
<p>Here is an XY chart made using numbers for its X values. Of course, this is what XY charts were designed for, so both the X and Y numbers are plotted along the X and Y axes according to their numerical values.</p>
<p align="center"><img title="XY Chart - Value X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYNumbers.png" alt="XY Chart - Value X Axis" width="192" height="136" /></p>
<p><em><strong>Dates</strong></em></p>
<p>The following data has a column of date for X and a column of numerical values for Y.</p>
<p align="center"><img title="Date X data" src="http://peltiertech.com/WordPress/wp-content/img200807/DataDates.png" alt="Date X data" width="155" height="137" /></p>
<p>The default Line and Column charts using this data are shown below. Unlike the treatment of text or numbers as nonnumeric category labels, the dates are treated as numerical dates, with the spacing between points proportional to the number of days between points. By default, the X axis stretches from the first date to the last, and Excel has chosen a &#8220;nice&#8221; X axis spacing of 7 days (one week).</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineDate.png" alt="Line Chart - Date-Scale X Axis" width="192" height="136" /> <img title="Column Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColDate.png" alt="Column Chart - Date-Scale X Axis" width="192" height="136" /></p>
<p>Here is an XY chart made using dates for its X values. Like the Line and Column charts shown above, the spacing of points along the X axis is proportional to the date value of the X data. The axis scale parameters are chosen as for any other value axis. The minimum, 12/29/2007, is day number 39445 in Excel&#8217;s date-time system*, the maximum, 2/7/2008, is day number 39485, and the spacing is 5 days. The formatting of the Line chart&#8217;s date-scale axis is much nicer.</p>
<p align="center"><img title="XY Chart - Date X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYDate.png" alt="XY Chart - Date X Axis" width="192" height="136" /></p>
<p style="padding-left: 30px;">* Excel stores dates and times as a mixed number: the whole number part is the number of days since January 1, 1900, and the fractional part is the fraction of the day elapsed since midnight (e.g., noon = 0.5, 6 pm = 0.75).</p>
<p><em><strong>Weekly Dates</strong></em></p>
<p>The superiority of Excel&#8217;s date-scale axis for a chart&#8217;s X axis is better illustrated with a broader range of dates. This table shows Friday dates for the first three months of 2008.</p>
<p align="center"><img title="Weekly Date X data" src="http://peltiertech.com/WordPress/wp-content/img200807/DataWeeks.png" alt="Weekly Date X data" width="162" height="256" /></p>
<p>The default Line and Column charts using this data are shown below. The X axis stretches from the first date to the last, and Excel has chosen a &#8220;nice&#8221; calendar-related X axis spacing of 14 days (two weeks). The column chart illustrates a &#8220;problem&#8221; people have with using column charts with date-scale axes. The columns are very thin, and there is no way to make them much wider. Even changing the gap width to zero, which makes adjacent columns touch each other, leaves a large gap. This gap is created by the date-scale axis itself, which provides a slot for each day along the axis. Weekly data then consists of one data point followed by six blank slots before the next data point. Since line charts are generally a better tool to illustrate time series data, this is just one more reason not to use a column chart in this context.</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineWeek1.png" alt="Line Chart - Date-Scale X Axis" width="256" height="170" /> <img title="Column Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColWeek1.png" alt="Column Chart - Date-Scale X Axis" width="256" height="170" /></p>
<p>The corresponding XY chart is shown below. Its X axis scale is not calendar based, starting on Monday, 12/24/2007 (day 39440), and ending on Wednesday, 4/2/2008 (day 39540), with a tick spacing of 10 days.</p>
<p align="center"><img title="XY Chart - Date X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYWeek1.png" alt="XY Chart - Date X Axis" width="256" height="170" /></p>
<p>We can clean up the Line chart&#8217;s X axis by removing the year and rotating the resulting labels (below left) and fix up the XY chart&#8217;s X axis in the same way, and also by incorporating week-based scale parameters (below right). The charts are essentially identical.</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineWeek2.png" alt="Line Chart - Date-Scale X Axis" width="256" height="170" /> <img title="XY Chart - Date X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYWeek2.png" alt="XY Chart - Date X Axis" width="256" height="170" /></p>
<p>If we format the date-scale axis to show months, the Line chart does so nicely, with a tick mark at the beginning of each month, regardless of the number of days in the preceding month. The XY chart comes up short, because we have to use a &#8220;best-fit&#8221; major unit, in this case, 30-1/3 days. January is represented in two tick mark labels and February not at all along the XY chart&#8217;s X axis.</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineWeek3.png" alt="Line Chart - Date-Scale X Axis" width="256" height="170" /> <img title="XY Chart - Date X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYWeek3.png" alt="XY Chart - Date X Axis" width="256" height="170" /></p>
<p>Taken over a whole year, with a &#8220;best-fit&#8221; major unit of 30-1/2 days per month (366 days/12 months), the XY chart (shown under the Line chart, below) is even less appealing. January is shown in two tick mark labels, February not at all, and three months (March, May, and July) on the second of the month, not the first.</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineYear.png" alt="Line Chart - Date-Scale X Axis" width="384" height="85" /><br />
 <img title="XY Chart - Date X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/XYYear.png" alt="XY Chart - Date X Axis" width="384" height="85" /></p>
<p>It is for this reason that I will often use a Line-XY combination chart: I get the benefit of the Line chart&#8217;s nice date-scale axis without the Line chart&#8217;s requirement that all series use the same X values.</p>
<p><em><strong>Axis Types (Chart Options)</strong></em></p>
<p>The axis types shown above for the Line, Column, and Area charts were assigned automatically by Excel, based on the X values data. You can actually tell Excel which type to use. For example, in your chart of stock prices, Excel plots every value by date, and leaves gaps in the chart for Saturdays and Sundays. You can omit the gaps by forcing Excel to use a Category type axis instead of a Date-Scale axis. In Excel 2003 and earlier, you can select Chart Options from the Chart menu, and the Axes tab of the resulting dialog lets you select which axes to use in the chart (in Excel 2007 these options are available on the Format Axis dialog). In the Line chart&#8217;s dialog (below left), the three options Automatic, Category, and Time-Scale (correctly renamed &#8220;Date-Scale&#8221; in Excel 2007) are available for selection. In the XY chart&#8217;s dialog (below right) these options are visible but disabled.</p>
<p align="center"><img title="Chart Options Axes Tab for Line Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/ChartOptionsAxesLine.png" alt="Chart Options Axes Tab for Line Chart" width="144" height="179" /> <span style="color: white;">&#8212;-</span> <img title="Chart Options Axes Tab for XY Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/ChartOptionsAxesXY.png" alt="Chart Options Axes Tab for XY Chart" width="144" height="179" /></p>
<p>In the following pairs of charts, the left hand one uses the Automatic (Category) axis, while the right hand one uses the Date-Scale type. The left hand charts, repeated from above, treat numerical X data as nonnumerical categories. In the right hand charts, the numbers in the X data are forced to be interpreted numerically, and plotted proportionally, not uniformly. The right hand charts are horizontally compressed because Excel leaves room for the longer axis tick labels which may extend beyond the plot area. The dates begin with day 1 (January 1, 1900).</p>
<p align="center"><img title="Line Chart - Category X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineNumbers.png" alt="Line Chart - Category X Axis" width="192" height="136" /> <img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineNumbersDate1.png" alt="Line Chart - Date-Scale X Axis" width="192" height="136" /></p>
<p align="center"><img title="Column Chart - Category X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColNumbers.png" alt="Column Chart - Category X Axis" width="192" height="136" /> <img title="Column Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColNumbersDate.png" alt="Column Chart - Date-Scale X Axis" width="192" height="136" /></p>
<p>The Line chart (above right) can almost be converted into an XY chart, by changing the X axis number format from a date format to a numerical format (such as &#8220;General&#8221;), setting the value axis not to cross between categories, and choosing appropriate scale parameters. Of course, it&#8217;s not perfect; since the first day in Excel&#8217;s date-time system is 1/1/1900, the smallest value that can be used as the X axis minimum is 1, not 0.</p>
<p align="center"><img title="Line Chart - Category X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineNumbersDate2.png" alt="Line Chart - Date-Scale X Axis" width="192" height="136" /></p>
<p>This technique comes in handy when combining an XY chart with an area chart, to fill the area <a title="XY Area Chart: Fill Below an XY Series" href="http://peltiertech.com/Excel/Charts/XYAreaChart.html">under</a> or <a title="XY Area Chart: Fill Between XY Series" href="http://peltiertech.com/Excel/Charts/XYAreaChart2.html">between</a> XY chart series.</p>
<p align="center"><a title="XY Area Chart: Fill Below an XY Series" href="http://peltiertech.com/Excel/Charts/XYAreaChart.html"><img title="XY Area Chart: Fill Below an XY Series" src="http://peltiertech.com/WordPress/wp-content/img200807/FillBelow.png" alt="XY Area Chart: Fill Below an XY Series" width="192" height="136" /></a> <a title="XY Area Chart: Fill Between XY Series" href="http://peltiertech.com/Excel/Charts/XYAreaChart2.html"><img src="http://peltiertech.com/WordPress/wp-content/img200807/FillBetween.png" alt="" width="192" height="136" /></a></p>
<p>In the following pairs of charts, the left hand one uses the Automatic (Date-Scale) axis, while the right hand one uses the Category type. The left hand charts, repeated from above, plot the dates in their X values proportionally. In the right hand charts, the dates are plotted uniformly, not proportionally.</p>
<p align="center"><img title="Line Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineDate.png" alt="Line Chart - Date-Scale X Axis" width="192" height="136" /> <img title="Line Chart - Category X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/LineDateCat.png" alt="Line Chart - Category X Axis" width="192" height="136" /></p>
<p align="center"><img title="Column Chart - Date-Scale X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColDate.png" alt="Column Chart - Date-Scale X Axis" width="192" height="136" /> <img title="Column Chart - Category X Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/ColDateCat.png" alt="Column Chart - Category X Axis" width="192" height="136" /></p>
<p>This technique is useful to plot stock data while omitting gaps for weekends. Frankly I prefer the time scale axis; the gaps where the weekends occur give me a better sense for the date values.</p>
<p align="center"><img title="Stock Chart - Date-Scale Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/StockDate.png" alt="Stock Chart - Date-Scale Axis" width="192" height="136" /> <img title="Stock Chart - Category Axis" src="http://peltiertech.com/WordPress/wp-content/img200807/StockCat.png" alt="Stock Chart - Category Axis" width="192" height="136" /></p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=6Iied7"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=6Iied7" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=L7lXmJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=L7lXmJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/341530348" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/21/excel-category-axis-types/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F21%2Fexcel-category-axis-types%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/21/excel-category-axis-types/</feedburner:origLink></item>
		<item>
		<title>California Majority Party by County</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/339052669/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/18/california-majority-party-by-county/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 14:41:04 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Example Charts]]></category>

		<category><![CDATA[Formatting]]></category>

		<category><![CDATA[column chart]]></category>

		<category><![CDATA[line chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=155</guid>
		<description>Nathan Yau of FlowingData asks Can You Improve this Mediocre Statistical Graphic?

So what&amp;#8217;s wrong with this chart?
1. Image Clarity. Nathan&amp;#8217;s screen shot of the original chart was pretty fuzzy, so I went to the source and captured it again, and that&amp;#8217;s what I show above. I don&amp;#8217;t thing a sharper image of this chart is [...]</description>
			<content:encoded><![CDATA[<p><strong>Nathan Yau</strong> of <a href="http://flowingdata.com/">FlowingData</a> asks <a href="http://flowingdata.com/2008/07/18/can-you-improve-this-mediocre-statistical-graphic/">Can You Improve this Mediocre Statistical Graphic?</a></p>
<p align="center"><img title="Mediocre Statistical Graph" src="http://peltiertech.com/WordPress/wp-content/img200807/CAVotersOriginal.png" alt="Mediocre Statistical Graph" width="559" height="298" /></p>
<p>So what&#8217;s wrong with this chart?<span id="more-155"></span></p>
<p><em><strong>1. Image Clarity.</strong></em> Nathan&#8217;s screen shot of the original chart was pretty fuzzy, so I went <a href="http://www.swivel.com/graphs/show/26277754">to the source</a> and captured it again, and that&#8217;s what I show above. I don&#8217;t thing a sharper image of this chart is what Nathan was thinking.</p>
<p><em><strong>2. Chart type?</strong></em> The data points are measured discretely every four years, so a line chart is less imperative than for most time series. If a line chart is used, it should have markers for the points to emphasize their discrete nature, and the lines should be straight, not smoothed. Otherwise the chart implies that the data series are continuous.</p>
<p><em><strong>3. Horizontal Axis.</strong></em> The 5-year tick spacing along the horizontal axis is confusing and misleading. It must be redrawn to accurately label the years where the measurements were made.</p>
<p><strong><em>4. Color Scheme.</em></strong> In recent campaigns, the colors red and blue have become synonymous with the Democrat and Republican parties, so the use of green shades in this chart misses an opportunity to add understanding.</p>
<p><em><strong>5. Labeling.</strong></em> The chart title and axis titles were misleading or nonexistent. The series were unlabeled.</p>
<p>I&#8217;ve produced the following two charts, the first a clustered column chart, the second a line chart. These may not be perfect, but they are a substantial improvement over the chart Nathan wants to fix.</p>
<p align="center"><img title="Column Chart of California Registered Voters by County" src="http://peltiertech.com/WordPress/wp-content/img200807/CAVotersColumn.png" alt="Column Chart of California Registered Voters by County" width="384" height="255" /></p>
<p align="center"><img title="Line Chart of California Registered Voters by County" src="http://peltiertech.com/WordPress/wp-content/img200807/CAVotersLine.png" alt="Line Chart of California Registered Voters by County" width="384" height="255" /></p>
<p><em><strong>Update (7/18/2008):</strong></em></p>
<p>What else is wrong with the chart? National elections are not decided on a county-by-county basis. The statewide percentages of registered Democratic to Republican voters has not changed as much as the county weightings have changed, and the parties have not switched places in the ranks. Both parties have declined slowly, with Democrats always being around 8-10 percentage points higher. &#8220;Other&#8221; has remained essentially unchanged, and interestingly enough &#8220;No Answer&#8221; has doubled during the time period shown.</p>
<p align="center"><img title="Line Chart of Statewide California Registered Voters" src="http://peltiertech.com/WordPress/wp-content/img200807/CApctregline.png" alt="Line Chart of Statewide California Registered Voters" width="321" height="222" /></p>
<p><em><strong>Update (7/19/2008):</strong></em></p>
<p>What is wrong with the voters? A closer look at the numbers shows that in the majority of the years surveyed, more eligible voters were unregistered than were registered with any one party. The first chart shows actual numbers of voters, and we see that the raw numbers of voters who admit to being registered as either Republican or Democrat have held roughly steady over the five primary seasons. Those unregistered and those declining to answer have steadily increased. There must have been a voter registration effort before the 1996 primary season, when nearly 2.5 million people left the ranks of unregistered voters. (Part of the jump may also be due to a revision in the census of total eligible voters.)</p>
<p align="center"><img title="Line Chart of Statewide California Eligible Voters by Number" src="http://peltiertech.com/WordPress/wp-content/img200807/CAnumbersline.png" alt="Line Chart of Statewide California Eligible Voters by number" width="343" height="222" /></p>
<p align="center"><img title="Line Chart of Statewide California Eligible Voters by Pct" src="http://peltiertech.com/WordPress/wp-content/img200807/CApcteligline.png" alt="Line Chart of Statewide California Eligible Voters by Pct" width="343" height="222" /></p>
<p><em><strong>Update (7/19/2008):</strong></em></p>
<p>Jorge Camoes has <a title="Chart redesign: California majority party by county" href="http://charts.jorgecamoes.com/chart-redesign-california-majority-party-by-county/">proposed a sparkline chart</a> to show the county majority party data. <img style="vertical-align: middle" title="Jorge Camoes' Sparkline of California Registered Voters by County" src="http://peltiertech.com/WordPress/wp-content/img200807/jorgedemocrats2.gif" alt="Jorge Camoes' Sparkline of California Registered Voters by County" width="31" height="22" /> Jorge&#8217;s chart shows the difference between the percentage of Democrat-majority counties and 50%. I find his chart potentially confusing because (a) there&#8217;s no indication of vertical scale, (b) the difference from 50% requires extra mental processing, (c) mixing of colors for a single series makes in unclear, particularly when one of the colors (red) is often used to denote the party which is not the one shown in the chart.</p>
<p>I made a simple stacked column sparkline, which works better for me. <img style="vertical-align: middle" title="Column Chart Sparkline of California Registered Voters by County" src="http://peltiertech.com/WordPress/wp-content/img200807/CAsparkline.png" alt="Column Chart Sparkline of California Registered Voters by County" width="64" height="25" />You get a sense of scale, at least, that the full height of the graphic is the full number of counties. The colors are also the conventional Democrat blue and Republican red. I would not want to stack more than two series, especially in a sparkline. Also, thee problem with a sparkline is that a more detailed analysis (as in my updates to this post) requires more series to explain.</p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=sJ4JqR"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=sJ4JqR" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=mgk7tJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=mgk7tJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/339052669" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/18/california-majority-party-by-county/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F18%2Fcalifornia-majority-party-by-county%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/18/california-majority-party-by-county/</feedburner:origLink></item>
		<item>
		<title>A Gauge that Works?</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/338933679/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/18/a-gauge-that-works/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 11:48:41 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Bad Charts]]></category>

		<category><![CDATA[Chart Types]]></category>

		<category><![CDATA[Charting Principles]]></category>

		<category><![CDATA[Dashboards]]></category>

		<category><![CDATA[Example Charts]]></category>

		<category><![CDATA[gauge]]></category>

		<category><![CDATA[line chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=151</guid>
		<description>In A Gauge Chart That Works?, Clint describes his efforts to come up with a dial-type chart that isn&amp;#8217;t as terrible as most. He comments that Stephen Few&amp;#8217;s Bullet Graphs are unfamiliar to most people, which is true, ans they&amp;#8217;ve only been around for three or four years. Bullet graphs and most gauge-type charts are [...]</description>
			<content:encoded><![CDATA[<p>In <a href="http://blog.instantcognition.com/excel/2008/07/14/a-gauge-chart-that-works/">A Gauge Chart That Works?</a>, Clint describes his efforts to come up with a dial-type chart that isn&#8217;t as terrible as most. He comments that <a title="Perceptual Edge" href="http://perceptualedge.com">Stephen Few</a>&#8217;s <a title="Bullet Graph Design Spec (pdf)" href="http://www.perceptualedge.com/articles/misc/Bullet_Graph_Design_Spec.pdf">Bullet</a> <a title="Bullet Graphs for Not-to-Exceed Targets" href="http://www.perceptualedge.com/blog/?p=217">Graphs</a> are unfamiliar to most people, which is true, ans they&#8217;ve only been around for three or four years. Bullet graphs and most gauge-type charts are tricky to create and maintain, since they rely on a melange of chart types and additional chart elements to produce unusual visual effects. Clint&#8217;s boss wanted a gauge, but Clint didn&#8217;t want to work with ugly, bulky dial gauge replicas. Long story short, Clint designed the following gauge to show page views in a web site he was watching:</p>
<p align="center"><img title="Clint's Gauge Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/gauge-line.png" alt="Clint's Gauge Chart" width="330" height="216" /></p>
<p>I&#8217;m not wild about the new gauge, but it isn&#8217;t totally awful. I&#8217;m not sure that a bullet-style graph with this color scheme couldn&#8217;t have been used (shown below without the text elements), but I&#8217;ll leave that discussion alone. I also won&#8217;t dwell on the observation that a bullet chart is really a gauge at heart.</p>
<p align="center"><img title="Bullet-Style Graph" src="http://peltiertech.com/WordPress/wp-content/img200807/bullet.png" alt="Bullet-Style Graph" width="294" height="45" /></p>
<p>On the positive side, Clint&#8217;s graph is linear instead of circular. Also, the new Excel 2007 feature is nice that allows arrowheads on series lines and error bars. <em>(One of the few nice things about Excel 2007 charting, and not worth putting up with the problems.)</em></p>
<p>On the negative side, it&#8217;s a gauge. Gauges like this only show one point in time; there&#8217;s no historical context, and you can&#8217;t tell if your month to date numbers are on target to hit the total per month target. Also, what happens if the value <a title="This is Spinal Tap" href="http://www.imdb.com/title/tt0088258/quotes">goes to 11</a>? Seriously, there is no provision for an out-of-scale measurement.</p>
<p>I&#8217;ve sworn off gauges myself. I&#8217;ve removed a speedometer tutorial from my web site, for at least a couple of reasons. First, it is a poor display device, for all the reasons stated above and elsewhere. Second, I would receive too many questions from people who didn&#8217;t understand enough math to customize it. It&#8217;s algebra and a little trig: find a tenth grader to help, people!</p>
<p>To overcome these issues, I returned to an old standby, the line chart. I use a category value to show days elapsed during the month, and vertical measures of page view targets and measurements. Colored backgrounds are made using stacked columns to provide a bad-medium-good scale across the chart, and dual scales, showing values and percentage of target, decorate the vertical sides of the chart. I also stuck with colors similar to Clint&#8217;s. Here is my non-gauge chart:</p>
<p align="center"><img title="Line Chart Showing Performance Against Monthly Target" src="http://peltiertech.com/WordPress/wp-content/img200807/cum-line.png" alt="Line Chart Showing Performance Against Monthly Target" width="321" height="212" /></p>
<p>This chart takes up about as much space as Clint&#8217;s, but it adds the missing time component. I can visually extrapolate the line forward to the end of the month and estimate whether we&#8217;ll hit our target. Since Clint&#8217;s chart has some empty space, it can be shrunk; so can the line chart without too much difference in legibility:</p>
<p align="center"><img title="Shrunken Line Chart" src="http://peltiertech.com/WordPress/wp-content/img200807/cum-line-2.png" alt="Shrunken Line Chart" width="229" height="146" /></p>
<p>Through the use of (ahem!) clever formulas, these charts can be made to adapt when the value exceeds the target:</p>
<p align="center"><img title="Line Chart Goes to Eleven" src="http://peltiertech.com/WordPress/wp-content/img200807/cum-line-goesto11.png" alt="Line Chart Goes to Eleven" width="321" height="212" /></p>
<p>When I have a chance to pretty it up, I&#8217;ll post a tutorial showing how I created this chart.</p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=ksnZSO"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=ksnZSO" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=xEDjWJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=xEDjWJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/338933679" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/18/a-gauge-that-works/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F18%2Fa-gauge-that-works%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/18/a-gauge-that-works/</feedburner:origLink></item>
		<item>
		<title>2008 East Coast Excel User Conference</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/338082685/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/17/2008-east-coast-excel-user-conference/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 14:10:38 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<category><![CDATA[Excel User Conference]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=150</guid>
		<description>Come to Atlantic City, New Jersey,  on September 24-26, 2008 for the Microsoft Excel User Conference (to be held at the Trump Taj Mahal).
The conference will feature working sessions and classes designed to expand a user&amp;#8217;s working knowledge of the dominant spreadsheet software. These sessions will be led by respected leaders in the Microsoft [...]</description>
			<content:encoded><![CDATA[<p>Come to Atlantic City, New Jersey,  on September 24-26, 2008 for the <a title="2008 US East Coast Excel / Access User Conference" href="http://www.exceluserconference.com/ECEUC.html">Microsoft Excel User Conference</a> (to be held at the Trump Taj Mahal).</p>
<p>The conference will feature working sessions and classes designed to expand a user&#8217;s working knowledge of the dominant spreadsheet software. These sessions will be led by respected leaders in the Microsoft Excel community. Some are respected authors and consultants, and all have the MVP designation - Microsoft Most Valuable Professional (MVP). The Microsoft Office gurus are Bernard Liengme, Damon Longworth, Bob Umlas and myself. I&#8217;ll be holding <a title="PTS Charting Classes" href="http://peltiertech.com/WordPress/2008/04/07/pts-charting-classes/">my two charting classes</a>: <strong>Advanced Charting Techniques</strong> and <strong>Excel Charting with VBA</strong>.</p>
<p>For information and registration, follow the link below. Register early for a discounted fee.</p>
<p><a title="2008 UE East Coast Excel / Access User Conference" href="http://www.exceluserconference.com/ECEUC.html">2008 US East Coast Excel User Conference</a><br />
 Atlantic City, New Jersey - Sept 24-26, 2008<br />
 <a title="Excel User Conferences" href="http://www.ExcelUserConference.com/">Excel User Conferences Home Page</a></p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=9vX3z0"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=9vX3z0" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=GfV6fJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=GfV6fJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/338082685" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/17/2008-east-coast-excel-user-conference/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F17%2F2008-east-coast-excel-user-conference%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/17/2008-east-coast-excel-user-conference/</feedburner:origLink></item>
		<item>
		<title>Update Regular Chart when Pivot Table Updates</title>
		<link>http://feeds.feedburner.com/~r/peltiertech/EsrO/~3/337676001/</link>
		<comments>http://peltiertech.com/WordPress/2008/07/16/update-regular-chart-when-pivot-table-updates/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 03:23:37 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
		
		<category><![CDATA[Data Techniques]]></category>

		<category><![CDATA[Pivot Tables]]></category>

		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=153</guid>
		<description>A reader named Julie has a regular chart that is linked to a pivot table. When the pivot table is pivoted or updated, it may have different numbers of rows and columns, and the chart must be updated manually. Julie asked whether a procedure could be developed to update the chart automatically.
I&amp;#8217;ve done this in [...]</description>
			<content:encoded><![CDATA[<p>A reader named Julie has a regular chart that is linked to a pivot table. When the pivot table is pivoted or updated, it may have different numbers of rows and columns, and the chart must be updated manually. Julie asked whether a procedure could be developed to update the chart automatically.</p>
<p>I&#8217;ve done this in a number of projects, so I thought I&#8217;d illustrate it with a simple example. Let&#8217;s start with this dummy data in a list (I&#8217;m using Excel 2003).</p>
<p align="center"><img title="Pivot Table Source Data" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Source_List.png" alt="Pivot Table Source Data" width="193" height="154" /></p>
<p>Insert a pivot table using this data. Drag the Item field to the Rows area, the Category field to the Columns area, and the Value field to the Data area. Simple enough.</p>
<p align="center"><img title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Item_by_Category.png" alt="Pivot Table" width="193" height="103" /></p>
<p>Now <a href="http://peltiertech.com/WordPress/2008/06/13/regular-charts-from-pivot-tables/">create a regular chart from this pivot table</a>, using series in columns, one series per item in the Category field, Category entries (alpha and beta) as series names, and the item names as category (X) axis labels.</p>
<p align="center"><img title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Item_by_Category.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p><span id="more-153"></span>In order to determine which ranges to use for the chart&#8217;s source data, it helps to understand what parts of a pivot table are designated as certain ranges. This color coded pivot table illustrates the RowRange, the ColumnRange, the DataBodyRange, and the DataLabelRange. Several of these will be used in the procedure below.</p>
<p align="center"><img title="Definitions of Ranges in a Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Range_Defs.png" alt="Definitions of Ranges in a Pivot Table" width="193" height="188" /></p>
<p>I have set up the macro to put series in columns unless the pivot table DataBodyRange has only one row, in which case there is only one series, and it is plotted by row.</p>
<p>Here is the VBA procedure. Implement it using <a class="simple_alink" title="How To: Use Someone Else's Macro" href="../2008/03/09/how-to-use-someone-elses-macro/">How To: Use Someone Else’s Macro</a>.</p>
<pre class="vba">Sub UpdateChartFromPivotTable()
  Dim rValues As Range
  Dim rCats As Range
  Dim rTitles As Range
  Dim cht As Chart
  Dim pt As PivotTable
  Dim chttype As XlChartType
  Dim iSrsIx As Long
  Dim iSrsCt As Long
  Dim iCols As Long
  Dim iRows As Long

  Set cht = ActiveSheet.ChartObjects(1).Chart
  Set pt = ActiveSheet.PivotTables(1)

  Set rValues = pt.DataBodyRange
  On Error Resume Next
  iRows = pt.RowRange.Rows.Count
  iCols = pt.ColumnRange.Columns.Count
  On Error GoTo 0

  If iRows &gt; 0 Then
    Set rCats = Intersect(rValues.EntireRow, pt.RowRange.EntireColumn)
    If iCols &gt; 0 Then
      Set rTitles = Intersect(rValues.EntireColumn, pt.ColumnRange.EntireRow)
      Set rTitles = rTitles.Offset(1).Resize(rTitles.Rows.Count - 1)
    End If
    iSrsCt = rValues.Columns.Count
  ElseIf iCols &gt; 0 Then
    Set rCats = Intersect(rValues.EntireColumn, pt.ColumnRange.EntireRow)
    Set rCats = rCats.Offset(1).Resize(rCats.Rows.Count - 1)
    iSrsCt = rValues.Rows.Count
  Else
    MsgBox "Pivot Table has no fields in Rows area or Columns area.  ", _
        vbCritical + vbOKOnly
    GoTo ExitSub
  End If

  If cht.SeriesCollection.Count &gt; iSrsCt Then
    For iSrsIx = cht.SeriesCollection.Count To iSrsCt + 1 Step -1
      With cht.SeriesCollection(iSrsIx)
        chttype = .ChartType
        .ChartType = xlColumnClustered
        .Delete
      End With
    Next
  ElseIf cht.SeriesCollection.Count &lt; iSrsCt Then
    For iSrsIx = cht.SeriesCollection.Count + 1 To iSrsCt
      cht.SeriesCollection.NewSeries
    Next
  End If

  For iSrsIx = 1 To cht.SeriesCollection.Count
    With cht.SeriesCollection(iSrsIx)
      chttype = .ChartType
      .ChartType = xlColumnClustered
      .XValues = rCats
      If iRows &gt; 0 Then
        .Values = rValues.Columns(iSrsIx)
        If iCols &gt; 0 Then
          .Name = rTitles.Columns(iSrsIx)
        Else
          .Name = "Data"
        End If
      Else
        .Values = rValues.Rows(iSrsIx)
        .Name = "Data"
      End If
      .ChartType = chttype
    End With
  Next

ExitSub:

End Sub
</pre>
<p>&nbsp;</p>
<p>Whenever the pivot table changes you can run this procedure to update the chart. To make it run automatically when the pivot table updates, you could put this event procedure into the code module behind the sheet (to open the sheet&#8217;s code module, right click the sheet tab, click View Code).</p>
<pre class="vba">Private Sub Worksheet_Calculate()
  Application.EnableEvents = False

  UpdateChartFromPivotTable

  Application.EnableEvents = True
End Sub</pre>
<p>&nbsp;</p>
<p>This procedure runs every time the worksheet calculates, whether or not the pivot table is involved. To redraw the chart only when mandated by pivot table updates, in Excel 2003 and later you can use this event procedure instead:</p>
<pre class="vba">Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
  Application.EnableEvents = False

  If Target.Name = Me.PivotTables(1).Name Then
    UpdateChartFromPivotTable
  End If

  Application.EnableEvents = True
End Sub</pre>
<p>&nbsp;</p>
<p>You could further modify the code to update different charts which are based on different pivot tables. Modify the indexes in these lines, instead of using &#8220;1&#8243;.</p>
<pre class="vba">  Set cht = ActiveSheet.ChartObjects(1).Chart
  Set pt = ActiveSheet.PivotTables(1)</pre>
<p>&nbsp;</p>
<p>I have run through some permutations of the pivot table and chart:</p>
<p align="center"><img style="vertical-align: middle;" title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Item_by_Category.png" alt="Pivot Table" width="193" height="103" /> <img style="vertical-align: middle;" title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Item_by_Category.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p align="center"><img style="vertical-align: middle;" title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Category_by_Item.png" alt="Pivot Table" width="176" height="69" /> <img style="vertical-align: middle;" title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Category_by_Item.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p align="center">&nbsp;</p>
<p align="center"><img style="vertical-align: middle;" title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Item_Category.png" alt="Pivot Table" width="196" height="171" /> <img style="vertical-align: middle;" title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Item_Category.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p align="center"><img style="vertical-align: middle;" title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Category_Item.png" alt="Pivot Table" width="169" height="171" /> <img style="vertical-align: middle;" title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Category_Item.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p align="center">&nbsp;</p>
<p align="center"><img title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Item_Category_.png" alt="Pivot Table" width="430" height="69" /></p>
<p align="center"><img title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Item_Category_.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p align="center">&nbsp;</p>
<p align="center"><img title="Pivot Table" src="http://peltiertech.com/WordPress/wp-content/img200807/PT_Category_Item_.png" alt="Pivot Table" width="407" height="69" /></p>
<p align="center"><img title="Regular Chart from Pivot Data" src="http://peltiertech.com/WordPress/wp-content/img200807/Cht_Category_Item_.png" alt="Regular Chart from Pivot Data" width="300" height="187" /></p>
<p>&nbsp;</p>

<p><a href="http://feeds.feedburner.com/~a/peltiertech/EsrO?a=Qi51lr"><img src="http://feeds.feedburner.com/~a/peltiertech/EsrO?i=Qi51lr" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/peltiertech/EsrO?a=lSHmrJ"><img src="http://feeds.feedburner.com/~f/peltiertech/EsrO?i=lSHmrJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/peltiertech/EsrO/~4/337676001" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/2008/07/16/update-regular-chart-when-pivot-table-updates/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=peltiertech/EsrO&amp;itemurl=http%3A%2F%2Fpeltiertech.com%2FWordPress%2F2008%2F07%2F16%2Fupdate-regular-chart-when-pivot-table-updates%2F</feedburner:awareness><feedburner:origLink>http://peltiertech.com/WordPress/2008/07/16/update-regular-chart-when-pivot-table-updates/</feedburner:origLink></item>
	<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=peltiertech/EsrO</feedburner:awareness></channel>
</rss><!-- Dynamic Page Served (once) in 0.507 seconds -->
