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

<channel>
	<title>Peltier Tech Blog &#187; Combination Charts</title>
	<atom:link href="http://peltiertech.com/WordPress/category/combination-charts/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Thu, 09 Feb 2012 08:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Excel Chart With Colored Quadrant Background</title>
		<link>http://peltiertech.com/WordPress/excel-chart-with-colored-quadrant-background/</link>
		<comments>http://peltiertech.com/WordPress/excel-chart-with-colored-quadrant-background/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 14:14:10 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[background and fill]]></category>
		<category><![CDATA[Quadrant Chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=3332</guid>
		<description><![CDATA[A popular graphical technique divides the plotting area of a chart into four quadrants, to facilitate such analyses as risk-reward. For example, one axis shows risk and the other shows reward; the quadrants divide risk and reward into low and high regions, and the quadrants show the combinations (low risk-high reward, low risk-low reward, etc.). [...]]]></description>
			<content:encoded><![CDATA[<p>A popular graphical technique divides the plotting area of a chart into four quadrants, to facilitate such analyses as risk-reward. For example, one axis shows risk and the other shows reward; the quadrants divide risk and reward into low and high regions, and the quadrants show the combinations (low risk-high reward, low risk-low reward, etc.).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/QuadrantChart1.png" alt="Chart with colored quadrant background" /></p>
<p>This technique is not difficult to follow in Excel. The plotted points are in an XY series, while the colored quadrants are formed by stacked area chart series.</p>
<h2>First, The Data</h2>
<p>All of the data needed to build a chart with colored quadrants is shown in the screen shot below. The individual values to be plotted are in the blue shaded range, B2:C11. The axis scales I want to use are in the green tinted range, B13:D15. The data needed for the area chart series is in the light orange range, B18:G25.</p>
<p><span id="more-3332"></span><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/QuadChartData.png" alt="Data for chart with colored quadrant background" /></p>
<p>The orange (area chart) data range contains some formulas. The Baseline column is needed to ensure the same behavior in all versions of Excel (2000 through 2010). I want to scale the area chart horizontal scale from 0 to 1000 to provide enough resolution in the chart. Cells B19:B20 contain the value 0, and cells B24:B25 contain the value 1000. Cell B21 contains the formula</p>
<pre class="vbasmall"><code>=(B14-B13)/(B15-B13)*1000</code></pre>
<p>to scale the vertical boundary to the desired point along the horizontal scale, and cells B22 and B23 link back to B21.</p>
<p>Cells C19:C25 link to cell C13.</p>
<p>Cells D19, D22, E22, E25, F19, F22, G22, and G25 also link to cell C13. Cell D20 contains the formula</p>
<pre class="vbasmall"><code>=C14-C13</code></pre>
<p>and cells D21, E23, and E24 link to cell D20. Cell F20 contains the formula</p>
<pre class="vbasmall"><code>=C15-C14</code></pre>
<p>and cells F21, G23, and G24 link to cell F20.</p>
<p>Select the blue range and insert an XY (Scatter) chart, markers only, to start the charting process (below left). Copy the orange range, select the chart, and use Paste Special to add the data to the chart as new series, with data in columns, and check the first column and first row boxes (below right). This may push all of the plotted values to the left of the chart, but I had set fixed maximum and minimum axis parameters.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/MakeQuadChart01.png" alt="Creating chart with colored quadrant background" /></p>
<p>Change the Baseline series chart type to stacked area. This messes up the axes and scrunches the plotted values to the left of the chart (below left). Repeat for the Bottom Left, Bottom Right, Top Left, and Top Right series (below right). You may format the area series whenever you want. Keep in mind that Excel wants to use richly saturated colors, which will overwhelm the plotted points. I&#8217;ve used shades that are a couple steps lighter than the default fill colors. Also keep in mind that the Baseline series should be made transparent (no fill).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/MakeQuadChart02.png" alt="Creating chart with colored quadrant background" /></p>
<p>Format the Values series, and move it to the Secondary axis. This provides a secondary vertical axis (below left). On the Chart Tools &gt; Layout tab, click on Axes, and select the default Secondary Horizontal Axis option, which gives us the top of the plotting rectangle (below right).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/MakeQuadChart03.png" alt="Creating chart with colored quadrant background" /></p>
<p>Format the left vertical axis, and under Horizontal Axis Crosses, select Maximum Axis Value (below left). Then format the right vertical axis, and under Horizontal Axis Crosses, select Automatic (below right).</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/MakeQuadChart04.png" alt="Creating chart with colored quadrant background" /></p>
<p>Select the right vertical axis, and press Delete (below left). Format the top horizontal axis: under Axis Type, select Date Axis; for Axis Labels, select None; for Line Color, select No Line (below right); and under Position Axis, choose On Tick Marks.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/MakeQuadChart05.png" alt="Creating chart with colored quadrant background" /></p>
<p>Resize the plot area if necessary (you&#8217;ll have to select Plot Area from the selection dropdown at the top left of the Chart Tools &gt; Layout or Format tabs) and adjust any other formatting. Remove the unneeded Baseline legend entry by clicking once to select the legend and again on the &#8220;Baseline&#8221; label to select the legend entry, then press Delete. Don&#8217;t forget that Excel wants to use richly saturated colors for the area fills, which will overwhelm your value markers. Used colors that are a couple shades lighter than the defaults. Your chart is finished.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/QuadrantChart1.png" alt="Chart with colored quadrant background" /></p>
<p>You can change where the quadrant borders appear by changing the values in cells B14 and C14.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/QuadrantChart2.png" alt="Chart with colored quadrant background" /></p>
<p>The chart adjusts as soon as you change these values.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2011-09/QuadrantChart3.png" alt="Chart with colored quadrant background" />
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/excel-chart-with-colored-quadrant-background/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Build a Bar-Line Combination Chart</title>
		<link>http://peltiertech.com/WordPress/build-a-bar-line-combination-chart/</link>
		<comments>http://peltiertech.com/WordPress/build-a-bar-line-combination-chart/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 05:00:17 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[Bar-Line Combination]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2612</guid>
		<description><![CDATA[When you have two series in a chart, and you want to show them using two different chart types, you have a broad array of choices. If you have target and actual data for a set of product attributes, for example, you can make a column-line combination chart readily. Suppose your data looks like this [...]]]></description>
			<content:encoded><![CDATA[<p>When you have two series in a chart, and you want to show them using two different chart types, you have a broad array of choices. If you have target and actual data for a set of product attributes, for example, you can make a column-line combination chart readily.</p>
<p>Suppose your data looks like this (ignore the &#8220;height&#8221; column for now):</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLineData.png" alt="Bar-Line Combo Chart Data" /></p>
<p>Make a column chart with all of the data:</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine_Column.png" alt="Column Chart with Bar-Line Data" /></p>
<p><span id="more-2612"></span>Right click the Actual series, choose Chart Type from the pop up menu, and select a Line Chart subtype:</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine_ColumnLine.png" alt="Column-Line Combo Chart with Bar-Line Data" /></p>
<p>That was pretty easy.</p>
<p>What if you want to use horizontal bars? Perhaps the attribute labels are too long to make good category labels along the horizontal axis. Long ago I wrote a tutorial on <a href="http://peltiertech.com/Excel/Charts/BarLineCombo.html" rel="nofollow" title="Bar-Line Combination Charts" >Bar-Line Combination Charts</a> on my web site, but that&#8217;s a complicated example. Here&#8217;s a new, simpler version of that tutorial.</p>
<p>Let&#8217;s try the same approach as above. Here&#8217;s a chart with both series as bars:</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine01.png" alt="Bar-Line Combo Chart - Step 1" /></p>
<p>Right click on the Actual series, choose Chart Type, select the line with markers subtype. That&#8217;s no good. The bars increase in value from left to right, while the line values increase bottom to top.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine02.png" alt="Bar-Line Combo Chart - Step 2" /></p>
<p>So we need a new approach. Make a bar chart with the Target data.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine03.png" alt="Bar-Line Combo Chart - Step 3" /></p>
<p>We want the attributes listed in the opposite order, so format the vertical axis, check Categories in Reverse Order and Value Axis Crosses at Maximum.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine04.png" alt="Bar-Line Combo Chart - Step 4" /></p>
<p>Copy the Actual and Height columns of data, select the chart, and use Paste Special to add the data as a new series, series in columns, series names in first row, and categories in first column.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine05.png" alt="Bar-Line Combo Chart - Step 5" /></p>
<p>Right click on the Actual series, choose Chart Type, then select the Lines with Markers version of the XY chart type. Since Actual is used for the X values of the XY series, both series show Target and Actual increasing from left to right.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine06.png" alt="Bar-Line Combo Chart - Step 6" /></p>
<p>Here is how to compute the values in the Height column. There are five categories (attributes) along the left hand axis, and the XY series markers fall in the middle of each category.Y values for the XY series range from zero at the bottom to 5 at the top of the axis. The first point is for Attribute 1, and is plotted at a height of 4.5. The next one, for Attribute 2, is at 3.5, an so forth, as shown in this chart.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine07.png" alt="Bar-Line Combo Chart - Step 7" /></p>
<p>You have to keep both horizontal axes in the chart, and you have to make sure they stay synchronized when the data changes. But you can hide the top horizontal axis: format it so it uses no line and shows no tick labels.</p>
<p align="center"><img src="http://peltiertech.com/images/2009-11/BarLine08.png" alt="Finished Bar-Line Combo Chart" /></p>
<p>Well, that wasn&#8217;t so hard, either.</p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/build-a-bar-line-combination-chart/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Two Color XY-Area Combo Chart &#8211; Guest Post</title>
		<link>http://peltiertech.com/WordPress/two-color-xy-area-combo-chart-guest-post/</link>
		<comments>http://peltiertech.com/WordPress/two-color-xy-area-combo-chart-guest-post/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 05:00:58 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[area-xy combo]]></category>
		<category><![CDATA[Guest Post]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2490</guid>
		<description><![CDATA[Today&#8217;s post is written by David Montgomery, who has a new blog called David @ Work. David read two of my recent posts, Fill Below an XY Chart Series (XY-Area Combo Chart) and Fill Between XY Chart Series (XY-Area Combo Chart), and noted the lack of an explanation for different colors between XY series that [...]]]></description>
			<content:encoded><![CDATA[<p><em>Today&#8217;s post is written by David Montgomery, who has a new blog called <a href="http://davidmerlemontgomery.blogspot.com/" rel="nofollow" title="David @ Work" >David @ Work</a>. David read two of my recent posts, <a href="http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/">Fill Below an XY Chart Series (XY-Area Combo Chart)</a> and <a href="http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/">Fill Between XY Chart Series (XY-Area Combo Chart)</a>, and noted the lack of an explanation for different colors between XY series that cross.</em></p>
<p><em>David attacked the problem in his blog post <a href="http://davidmerlemontgomery.blogspot.com/2009/09/two-color-xy-area-combo-chart.html" rel="nofollow" >Two Color XY -Area Combo Chart</a>, and he has graciously accepted my offer to repost his article below.</em></p>
<h2>Two Color XY-Area Combo Chart</h2>
<p>Last Wednesday, Jon explained the technique for creating an <a href="http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/"title="Read this if you haven't already." >XY-area combo chart</a>. The original article shows how to color the area between two lines in a chart where the lines never cross. I&#8217;m going to assume you read the article and that we&#8217;re all starting at this point:</p>
<p align="center"><img style="width: 428px; height: 239px;" src="/images/2009-10/d678v8f_3htbs5zds_b.jpg" alt="" /></p>
<p>But what if you want to cross the lines? The good news is that this isn&#8217;t Ghostbusters and crossing the lines doesn&#8217;t break anything, the area between the lines is still filled in perfectly. If we flip the values in B5:C5, B7:C7, and B9:C9, we get the following:</p>
<p align="center"><img style="width: 520px; height: 257px;" src="/images/2009-10/d678v8f_4dd6g4bj2_b.jpg" alt="" /></p>
<p><span id="more-2490"></span>The bad news is that the fill series is only one color and as soon as you show it to your boss she&#8217;ll ask why the positive and negative areas aren&#8217;t green and red, respectively (which you shouldn&#8217;t do anyway because a lot of people are red/green colorblind). Before today, you would have said that it would take too long to add a second color, that it was impossible, or you would have just drawn auto shapes on top of the chart. Today though there is a much easier solution:</p>
<ol style="margin-left: 24pt;">
<li>Download the workbook at the end of this post.</li>
<li>Plug in your data values.</li>
<li>Profit.</li>
</ol>
<p>But if you&#8217;re like me, and I know I am, chances are you&#8217;re reading this blog because you want to learn how to do it yourself. At this time I should note that Excel 2003 and I have a monogamous relationship and that some of these steps may be different for other versions of Excel.</p>
<p>Okay, so the first thing that is obvious is that you&#8217;ll need to add another data series if you want an additional color. Creating separate positive and negative data series doesn&#8217;t work by itself though; you need your positive and negative shading to end where the lines <em>intersect</em>, but the shading will continue on to the next point on the x-axis with the current configuration.</p>
<p align="center"><img style="width: 518px; height: 256px;" src="/images/2009-10/d678v8f_5d3gk2jd6_b.jpg" alt="" /></p>
<p>What we need to do is find the x values at the points where the lines intersect and add them to our secondary x-axis (just a recap, the lines are on the primary x-axis, the shading on the secondary x-axis).</p>
<p>This isn&#8217;t as hard as it sounds, but when searching for a way to find the point where lines intersect in Excel I found a lot of people suggesting Goalseek. This deeply offends the math geek in me. Letting machines do math for you is only okay if you told it <em>exactly</em> what to do. If you didn&#8217;t tell it what to do, the computer is <em>thinking for you</em>, and that is a slippery slope to <a href="http://www.amazon.com/gp/product/B001VLBDD0?ie=UTF8&amp;tag=dawo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001VLBDD0" rel="nofollow" title="I have absolutely no shame."  target="_blank">Skynet</a>. But I digress&#8230;</p>
<p>The common formula for a straight line is <tt class="tt">y = mx + b</tt>, where m is the slope and b is the y-axis intercept. At each point of intersection in our chart, we have two lines:</p>
<p><tt class="tt">y<sub>1</sub> = m<sub>1</sub>x<sub>1</sub> + b<sub>1<br />
 </sub>y<sub>2</sub> = m<sub>2</sub>x<sub>2</sub> + b<sub>2</sub></tt></p>
<p>Because we want the point where the lines intersect, y<sub>1</sub> = y<sub>2</sub> and x<sub>1</sub> = x<sub>2</sub>. Also, because both of the formulas equal y, they are also equal to each other and we can simplify to:</p>
<p><tt class="tt">m<sub>1</sub>x + b<sub>1</sub> = m<sub>2</sub>x + b<sub>2</sub></tt></p>
<p>Solving for x gives us:</p>
<p><tt class="tt">x = (b<sub>2</sub>-b<sub>1</sub>)/(m<sub>1</sub>-m<sub>2</sub>)</tt></p>
<p>Slope <tt class="tt">m<sub>1</sub></tt> and intercept <tt class="tt">b<sub>1</sub></tt> correspond with the top line, the red one in the example, and <tt class="tt">m<sub>2</sub></tt> and <tt class="tt">b<sub>2</sub></tt> refer to the bottom/blue line. For now, let&#8217;s focus on the first point of intersection where the two bolded line segments cross:</p>
<p align="center"><img style="width: 514px; height: 248px;" src="/images/2009-10/d678v8f_6hs2hrwt5_b.jpg" alt="" /></p>
<p>Excel has built in functions for calculating the slope and the intercept for a range of x and y values which they&#8217;ve cleverly named SLOPE() and INTERCEPT(). We&#8217;ll only need two points to calculate each of our line segments, so our formulas to calculate the two slopes (m<sub>1</sub> &amp; m<sub>2</sub>) between the first and second points will look like this:</p>
<p align="center"><img style="width: 299px; height: 292px;" src="/images/2009-10/d678v8f_8fftv4nc7_b.jpg" alt="" /></p>
<p>Our two y-axis intercepts are calculated in the exact same way, just replace SLOPE with INTERCEPT. We&#8217;ll need to calculate the slope and intercept for both line segments at every point where the lines cross. If the lines don&#8217;t cross, we can skip the calculation.</p>
<p>Because the lines can potentially cross between any two data points, we&#8217;re doubling the size of the original secondary x-axis. Every other point will be one of the original data points, and the in-between points, which are the <em>potential</em> points of intersection, will either be NA() if the lines don&#8217;t cross (Excel will skip over #N/A errors when plotting most types of charts) or something like this formula (for cell G5) if they do cross:</p>
<p><tt class="tt">=(INTERCEPT(C4:C5,D4:D5)-INTERCEPT(B4:B5,D4:D5)) / <br />
 (SLOPE(B4:B5,D4:D5)-SLOPE(C4:C5,D4:D5))</tt></p>
<p>Remember that we&#8217;re just replacing the m and b values in <tt class="tt">x = (b<sub>2</sub>-b<sub>1</sub>)/(m<sub>1</sub>-m<sub>2</sub>)</tt> with the SLOPE() and INTERCEPT() functions. It isn&#8217;t as bad as it looks. In this image I&#8217;ve added the new secondary x-axis points in column G; the red shaded cells are the original points, and the blue points are the potential points of intersection that we&#8217;ve calculated:</p>
<p align="center"><img style="width: 516px; height: 361px;" src="/images/2009-10/d678v8f_9gtn8wgcp_b.jpg" alt="" /></p>
<p>Of course the formulas in the workbook are much uglier because I&#8217;m counting ROWS() and using the OFFSET() formula so I don&#8217;t have to manually add each line segment from the original data set, but it&#8217;s a little hard(er) to follow. Another trick to avoid manually entering each formula would be to insert blank cells between your original points in D4:F11. That way the original secondary x-axis and the new one in column G will be the same size and your formulas should copy down correctly.</p>
<p>So to recap, our new secondary x-axis should look something like column G. You still run from 0 to 1000, you still repeat the first and last value, and every other point is one of the original points as calculated in Jon&#8217;s original post. The points in between are #N/A errors if the lines don&#8217;t cross and the x values we just calculated for the points of intersection if the lines do cross. An easy way to tell if the lines cross?  In column F we had previously calculated the difference between the two original data series. If the product of any two adjacent points in column F is negative, the lines intersect between those two points. You should be able to add an IF() checking this at each potential point of intersection without too much trouble.</p>
<p>The next step is to rebuild the three Area data series. Area1 is the transparent base series, Area2 is the positive series, and Area3 is the new negative series.</p>
<p>To create Area1, every other row should point to an entry in the original series in column E. The in-between points should once again be NA() errors if the lines don&#8217;t intersect (same for Area2 and Area3 as well), and when they do intersect we just need to calculate the y value at that point. We already have the x value, so we can plug that into our y = mx + b equation. The formula for H5 would be:</p>
<p><tt class="tt">=SLOPE(B4:B5,D4:D5)*G5+INTERCEPT(B4:B5,D4:D5)</tt></p>
<p>You could also use the points C4:C5 for your y values as both line formulas will give the same result with that x value (G5).</p>
<p>Area2 and Area3 are incredibly straight forward. We still use the values in column F for every other cell, but the trick is that we only use the positive points in Area2 and only negative points in Area3, with the rest of the points being zero. This is easy to do with something like MAX(F4,0) for Area1 and MIN(F4,0) for Area3. All of the in-between points are either NA() errors (if there is no point of intersection) or zero. If everything worked correctly, your workbook should look like this:</p>
<p align="center"><img style="width: 648px; height: 317.406px;" src="/images/2009-10/d678v8f_10gzs3k4m7_b.jpg" alt="" /></p>
<p>Now you just need to add these new data series to the chart. Series 1 and 2 are the lines which should already be done, Series 3 (the transparent series) should now point to h2:h20, Series 4 (the positive series) should point to the values in column I, and you&#8217;ll have to add a Series 5 (negative) to point to the values in column J. The secondary x-axis values also need to be changed to the values in column G.</p>
<p>If your Series 5 didn&#8217;t default over to the secondary axes, you&#8217;ll have to switch it. Double click on Series 5, click on the &#8220;Axis&#8221; tab, and select the &#8220;Secondary axis&#8221; option.</p>
<p>Finally, double click on each area series, go to the &#8220;Patterns&#8221; tab, choose the two colors you think are the prettiest, and you&#8217;re all set.</p>
<p>If everything went correctly, you should have something like this:</p>
<p align="center"><img style="width: 517px; height: 257px;" src="/images/2009-10/d678v8f_11g42bq6g2_b.jpg" alt="" /></p>
<p>If not, the workbook will make more sense than I ever could:</p>
<p><a href="http://drop.io/davidatwork/" rel="nofollow" id="j:d7" title="The preview function of drop.io cannot fully comprehend the majesty of this workbook, and displays the contents as a twisted ruin."  target="_blank">TwoColorXYAreaChart.xls</a></p>
<p>And that&#8217;s all there is to it. Let me know what you think in the comments.</p>
<p>- David</p>
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/two-color-xy-area-combo-chart-guest-post/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Fill Between XY Chart Series (XY-Area Combo Chart)</title>
		<link>http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/</link>
		<comments>http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 05:00:10 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[area-xy combo]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2458</guid>
		<description><![CDATA[In Fill Below an XY Chart Series (XY-Area Combo Chart) I introduced a technique for filling the area below an XY chart. This article shows how to extend that technique to filling between two XY series. The trick is to use a chart that combines XY and Area type series. I described this technique in [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/"class="vt-p" title="Fill Below an XY Chart Series (XY-Area Combo Chart) | PTS Blog" >Fill Below an XY Chart Series (XY-Area Combo Chart)</a> I introduced a technique for filling the area below an XY chart. This article shows how to extend that technique to filling between two XY series.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2009-09/ComboXYFill2003_8.png" alt="Fill the area below and XY chart series" /></p>
<p>The trick is to use a chart that combines XY and Area type series. I described this technique in <a href="http://peltiertech.com/Excel/Charts/XYAreaChart2.html" rel="nofollow" class="vt-p" >XY Area Chart: Fill Between XY Series</a>, but that protocol doesn&#8217;t work the same in Excel 2007 as in earlier versions. Fortunately by rearranging some of the steps, a process can be designed that works for all versions of Excel, from 97 (maybe earlier) through 2007. This tutorial explains the redesigned  protocol.</p>
<p><span id="more-2458"></span>Here is the data for this example. The XY data is in columns A through C, and the area chart data in D through F. The X values of the area chart series will be plotted on a date scale which ranges from 0 to 1000 (1000 should provide plenty of resolution for a small chart). The minimum and maximum in column D are thus 0 and 1000. The other X values are scaled to the X values of the XY series, which will be scaled between 0 and 15.</p>
<p>The scaling formula in D4 is</p>
<p><tt class="tt">=INT(1000*A4/15+0.5)</tt></p>
<p>or in the general case</p>
<p><tt class="tt">=INT(1000*(A4-Xmin)/(Xmax-Xmin)+0.5)</tt></p>
<p>This formula is filled down to cell D11.</p>
<p>Cell D3 contains the formula <tt class="tt">=D4</tt>, and cell D12 contains the formula <tt class="tt">=D11</tt>.</p>
<p>The values in column E are linked to the corresponding values in column B, and the values in column F are the differences between the values in columns C and B, except for the zeros at the ends of the range. The duplicate X values produce a vertical edge in the area chart, when plotted on a date scale axis. The zeros at X=0 and X=1000 automatically scale the area chart axis, which is an improvement on the older technique.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://peltiertech.com/images/2009-09/ComboXYFillData.png" alt="XY-Area Combo Chart Data" /></p>
<p>The protocol starts by selecting the XY data range A3:C11 and creating a stacked area chart (not an XY chart as in the old protocol, since that gets messed up in Excel 2007). The Excel 2003 chart is shown at the left, the Excel 2007 chart at the right.</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_1.png" alt="XY-Area Combo Chart, Excel 2003 Step 1" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_1.png" alt="XY-Area Combo Chart, Excel 2007 Step 1" /></p>
<p>Continue by copying the area data in D1:F13, selecting the chart, and using Paste Special to add the copied data as a new series with categories in the first column and series names in the first row.<br class="spacer_" /></p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_2.png" alt="XY-Area Combo Chart, Excel 2003 Step 2" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_2.png" alt="XY-Area Combo Chart, Excel 2007 Step 2" /></p>
<p>Move the last two series to the secondary axis. In 2003 (left), double click on the series, and on the Axis tab, choose Secondary. In 2007 (right), right click on the series, choose Format Data Series, and on the Series Options tab, choose Secondary.<br class="spacer_" /></p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_3.png" alt="XY-Area Combo Chart, Excel 2003 Step 3" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_3.png" alt="XY-Area Combo Chart, Excel 2007 Step 3" /></p>
<p>Convert first two series are to the XY type. Right click on each series, choose Chart Type, and select the XY type and subtype you want.</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_4.png" alt="XY-Area Combo Chart, Excel 2003 Step 4" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_4.png" alt="XY-Area Combo Chart, Excel 2007 Step 4" /></p>
<p>Excel only adds a secondary Y axis, and we need a secondary X axis, with a date scale. In Excel 2003 (left), go to Chart menu &gt; Chart Options &gt; Axes tab, check the box in front of Secondary Category (X) Axis, and select the Time Scale option. Excel 2007 (right) requires two steps. First, on the Chart Tools &gt; Layout tab, click the Axes dropdown arrow, then Secondary Horizontal Axis, and select Show Left to Right Axis. Then right click the new axis, choose Format Axis, and under Axis Type on the Axis Options tab, select Date Axis</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_5.png" alt="XY-Area Combo Chart, Excel 2003 Step 5" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_5A.png" alt="XY-Area Combo Chart, Excel 2007 Step 5A" /><br />
<img src="http://peltiertech.com/images/2009-09/ComboXYAreaBlank.png" alt="" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_5B.png" alt="XY-Area Combo Chart, Excel 2007 Step 5B" /></p>
<p>Now hide the secondary X axis and make sure the highlighting in under (not over) the XY series. In Excel 2003 (left), step 1 is to double click on the axis, and on the Patterns tab, choose none for major and minor tick marks, tick labels, and axis lines. Excel 2003 Step 2 is to double click on the secondary Y axis, and on the Scale tab, uncheck Category (X) Axis Crosses At Maximum. In Excel 2007 (right), right click the axis, choose Format Axis, and on the Axis Options tab, choose None for major and minor tick mark types and tick labels, and on the Line Color tab, choose No Line. In 2007, the fill is already under the XY series despite the position of the X axis.<br class="spacer_" /></p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_6A.png" alt="XY-Area Combo Chart, Excel 2003 Step 6A" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_6.png" alt="XY-Area Combo Chart, Excel 2007 Step 6" /><br />
<img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_6B.png" alt="XY-Area Combo Chart, Excel 2003 Step 6B" /> <img src="http://peltiertech.com/images/2009-09/ComboXYAreaBlank.png" alt="" /></p>
<p>Finally, in either version of Excel, select the secondary Y axis (right edge of the chart), and press Delete.<br class="spacer_" /></p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_7.png" alt="XY-Area Combo Chart, Excel 2003 Step 7" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_7.png" alt="XY-Area Combo Chart, Excel 2007 Step 7" /></p>
<p>Finally, remove the fill below the lower XY series (unless you want to fill multiple areas).</p>
<p style="text-align: center;"><img src="http://peltiertech.com/images/2009-09/ComboXYFill2003_8.png" alt="XY-Area Combo Chart, Excel 2003 Step 8" /> <img src="http://peltiertech.com/images/2009-09/ComboXYFill2007_8.png" alt="XY-Area Combo Chart, Excel 2007 Step 8" /></p>
<p>You can download a zip file, <a href="http://peltiertech.com/images/2012-02/Combo-XY-Area.zip" rel="nofollow" class="vt-p" title="Zipped workbooks for Fill Below and Fill Between XY Series" >Combo-XY-Area.zip</a>, which includes Excel 2003 and 2007 workbooks illustrating  how to <a href="http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/"class="vt-p" title="Fill Below an XY Chart Series" >Fill Below an XY Chart Series</a> and <strong>Fill Between XY Chart Series</strong>.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Fill Below an XY Chart Series (XY-Area Combo Chart)</title>
		<link>http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/</link>
		<comments>http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 05:00:14 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[area-xy combo]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=2455</guid>
		<description><![CDATA[How can you fill the area below an XY series in an Excel chart? You can&#8217;t just use an area chart for this, because the X axis won&#8217;t work out right, and an Area chart does not provide markers, only border and fill. The trick is to use a chart that combines XY and Area [...]]]></description>
			<content:encoded><![CDATA[<p>How can you fill the area below an XY series in an Excel chart? You can&#8217;t just use an area chart for this, because the X axis won&#8217;t work out right, and an Area chart does not provide markers, only border and fill.</p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_7.png" alt="Fill the area below and XY chart series" /></p>
<p>The trick is to use a chart that combines XY and Area type series. I described this technique in an old article on my web site, but that protocol doesn&#8217;t work the same in Excel 2007 as in earlier versions. Fortunately by rearranging some of the steps, a process can be designed that works for all versions of Excel, from 97 (maybe earlier) through 2007. This tutorial explains the redesigned  protocol.</p>
<p><span id="more-2455"></span>Here is the data for this example. The XY data is in columns A and B, and the area chart data in C and D. The X values of the area chart series will be plotted on a date scale which ranges from 0 to 1000 (1000 should provide plenty of resolution for a small chart). The minimum and maximum in column C are thus 0 and 1000. The other X values are scaled to the X values of the XY series, which will be scaled between 0 and 15.</p>
<p>The scaling formula in C4 is</p>
<p><tt class="tt">=INT(1000*A4/15+0.5)</tt></p>
<p>or in the general case</p>
<p><tt class="tt">=INT(1000*(A4-Xmin)/(Xmax-Xmin)+0.5)</tt></p>
<p>This formula is filled down to cell C11.</p>
<p>Cell C3 contains the formula <tt class="tt">=C4</tt>, and cell C12 contains the formula <tt class="tt">=C11</tt>.</p>
<p>The values in column D are linked to the corresponding values in column B, except for the zeros at the ends of the range. The duplicate X values produce a vertical edge in the area chart, when plotted on a date scale axis. The zeros at X=0 and X=1000 automatically scale the area chart axis, which is an improvement on the older technique.</p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYAreaData.png" alt="XY-Area Combo Chart Data" /></p>
<p>The protocol starts by selecting the XY data range A3:B11 and creating an area chart (not an XY chart as in the old protocol, since that gets messed up in Excel 2007). The Excel 2003 chart is shown at the left, the Excel 2007 chart at the right.</p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_1.png" alt="XY-Area Combo Chart, Excel 2003 Step 1" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_1.png" alt="XY-Area Combo Chart, Excel 2007 Step 1" /></p>
<p>Continue by copying the area data in C1:D13, selecting the chart, and using Paste Special to add the copied data as a new series with categories in the first column and series names in the first row.<br class="spacer_" /></p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_2.png" alt="XY-Area Combo Chart, Excel 2003 Step 2" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_2.png" alt="XY-Area Combo Chart, Excel 2007 Step 2" /></p>
<p>The area series is moved to the secondary axis. In 2003 (left), double click on the series, and on the Axis tab, choose Secondary. In 2007 (right), right click on the series, choose Format Data Series, and on the Series Options tab, choose Secondary.<br class="spacer_" /></p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_3.png" alt="XY-Area Combo Chart, Excel 2003 Step 3" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_3.png" alt="XY-Area Combo Chart, Excel 2007 Step 3" /></p>
<p>The first series is then converted to an XY type. Right click on the series, choose Chart Type, and select the XY type and subtype you want.</p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_4.png" alt="XY-Area Combo Chart, Excel 2003 Step 4" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_4.png" alt="XY-Area Combo Chart, Excel 2007 Step 4" /></p>
<p>Excel only adds a secondary Y axis, and we need a secondary X axis, with a date scale. In Excel 2003 (left), go to Chart menu &gt; Chart Options &gt; Axes tab, check the box in front of Secondary Category (X) Axis, and select the Time Scale option. Excel 2007 (right) requires two steps. First, on the Chart Tools &gt; Layout tab, click the Axes dropdown arrow, then Secondary Horizontal Axis, and select Show Left to Right Axis. Then right click the new axis, choose Format Axis, and under Axis Type on the Axis Options tab, select Date Axis.<br class="spacer_" /></p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_5.png" alt="XY-Area Combo Chart, Excel 2003 Step 5" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_5A.png" alt="XY-Area Combo Chart, Excel 2007 Step 5A" /><br />
<img src="http://peltiertech.com/images/2009-09/ComboXYAreaBlank.png" alt="" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_5B.png" alt="XY-Area Combo Chart, Excel 2007 Step 5B" /></p>
<p>Now hide the secondary X axis and make sure the highlighting in under (not over) the XY series. In Excel 2003 (left), step 1 is to double click on the axis, and on the Patterns tab, choose none for major and minor tick marks, tick labels, and axis lines. Excel 2003 Step 2 is to double click on the secondary Y axis, and on the Scale tab, uncheck Category (X) Axis Crosses At Maximum. In Excel 2007 (right), right click the axis, choose Format Axis, and on the Axis Options tab, choose None for major and minor tick mark types and tick labels, and on the Line Color tab, choose No Line. In 2007, the fill is already under the XY series despite the position of the X axis.<br class="spacer_" /></p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_6A.png" alt="XY-Area Combo Chart, Excel 2003 Step 6A" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_6.png" alt="XY-Area Combo Chart, Excel 2007 Step 6" /><br />
<img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_6B.png" alt="XY-Area Combo Chart, Excel 2003 Step 6B" /> <img src="http://peltiertech.com/images/2009-09/ComboXYAreaBlank.png" alt="" /></p>
<p>Finally, in either version of Excel, select the secondary Y axis (right edge of the chart), and press Delete.<br class="spacer_" /></p>
<p><img src="http://peltiertech.com/images/2009-09/ComboXYArea2003_7.png" alt="XY-Area Combo Chart, Excel 2003 Step 7" /> <img src="http://peltiertech.com/images/2009-09/ComboXYArea2007_7.png" alt="XY-Area Combo Chart, Excel 2007 Step 7" /></p>
<p>My next post will show how to use a variation on this technique to <a href="http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/"class="vt-p" title="Fill Between XY Chart Series" >fill between two XY chart series</a>.</p>
<p>You can download a zip file, <a href="http://peltiertech.com/images/2012-02/Combo-XY-Area.zip" rel="nofollow" class="vt-p" title="Zipped workbooks for Fill Below and Fill Between XY Series" >Combo-XY-Area.zip</a>, which includes Excel 2003 and 2007 workbooks illustrating  how to <strong>Fill Below an XY Chart Series</strong> and <a href="http://peltiertech.com/WordPress/fill-between-xy-chart-series-xy-area-combo-chart/"class="vt-p" title="Fill Between XY Chart Series" >Fill Between XY Chart Series</a>.
<p>Peltier Technical Services, Inc., Copyright © 2011.<br /> <br /><span style="font: 80% Verdana,Tahoma,Arial,sans-serif;">Licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow" rel="license" >Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.<br /> <br />
<a href="http://www.exceluser.com/cmd.asp?Clk=1374689" rel="nofollow" ><IMG SRC="http://www.exceluser.com/images/info/pub/info_dash_c02.gif" ALT="Learn how to create Excel dashboards." WIDTH="468" HEIGHT="60" border=0></a><br />
<br /><img src="http://www.exceluser.com/cmd.asp?Imp=1374689" width="0" height="0" border="0"></p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/fill-below-an-xy-chart-series-xy-area-combo-chart/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>How to Build a Simple Panel Chart</title>
		<link>http://peltiertech.com/WordPress/how-to-build-a-simple-panel-chart/</link>
		<comments>http://peltiertech.com/WordPress/how-to-build-a-simple-panel-chart/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 11:00:50 +0000</pubDate>
		<dc:creator>Jon Peltier</dc:creator>
				<category><![CDATA[Combination Charts]]></category>
		<category><![CDATA[Panel Chart]]></category>

		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=906</guid>
		<description><![CDATA[In Challenge &#8211; Show Market Share Changes I suggested a panel chart in response to Chandoo&#8217;s Visualization Challenge &#8211; How to show market share changes? In Explore Your Data With Pivot Tables I showed how a simple pivot table analysis could lead to this type of chart. And in this post I will show the [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://peltiertech.com/WordPress/2008/11/10/challenge-show-market-share-changes/"title="Challenge - Show Market Share Changes" rel="bookmark" >Challenge &#8211; Show Market Share Changes</a> I suggested a panel chart in response to Chandoo&#8217;s <a href="http://chandoo.org/wp/2008/09/18/excel-charting-problem-how-to-show-market-share-in-2-different-periods/" rel="nofollow" title="Visualization Challenge - How to show market share changes?" >Visualization Challenge &#8211; How to show market share changes?</a> In <a href="http://peltiertech.com/WordPress/2008/11/11/explore-your-data-with-pivot-tables/"title="Explore Your Data With Pivot Tables" >Explore Your Data With Pivot Tables</a> I showed how a simple pivot table analysis could lead to this type of chart. And in this post I will show the data arrangement and techniques I used to create this chart.</p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">Panel Chart Data</h2>
<p>The data used for the chart is shown below. This first table contains data to be plotted in two XY chart series. The lines stretch across category labels at X values 1, 2, 3, 4, and 5. I arbitrarily selected ±0.33, which produces the pairs {0.67, 1.33}, {1.67, 2.33}, etc. In fact, these values are not hard coded. Outside of the range shown here I have the X values for the category labels {1, 2, 3, 4, 5} and the value 0.33. Formulas produce the X values; if I want a change, I can merely change the vaue from 0.33 to something different, and all of the X values update. Blank rows in the data will produce gaps in the otherwise continuous series. For example, a line is plotted between 0.67 and 1.33, a gap is present between 1.33 and 1.67, a line is drawn between 1.67 and 2.33, and so forth.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/paneldata.png" alt="panel chart data" /></p>
<p><span id="more-906"></span>The data for my dummy category axis labels is shown below. I will make a simple column chart with this series. Excel will place the C1 to C5 labels at X=1 to 5. The Y axis range is blank, so the column chart will have bars with zero height. (I could have used zero values as well.)</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelaxisdata.png" alt="panel chart axis data" /></p>
<h2 style="margin: 0pt 0pt 18px; font-size: 1em;">Building the Panel Chart</h2>
<p>Start by selecting the axis data and creating a column chart. I temporarily inserted values of 1 so it&#8217;s obvious what is going on. I&#8217;ve also already changed the axis and plot area lines to gray.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep01.png" alt="panel chart step 1" /></p>
<p>Clean up the chart. Since we&#8217;re concerned with relative trends, and because these are tiny little charts, I have removed the Y axis labels. I also removed the title and the X axis tick marks, and moved the legend to the top of the chart.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep02.png" alt="panel chart step 2" /></p>
<p>Now I&#8217;ve removed the &#8220;1&#8243; values in the axis data range.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep03.png" alt="panel chart step 3" /></p>
<p>Add the brand 1 and brand 2 data. Copy the range, select the chart, and use Paste Special to add the data as new series, with categories in the first column (but not replacing the existing categories) and series names in the first row. These series are added as more column series.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep04.png" alt="panel chart step 4" /></p>
<p>Select one of the added series, and change it to an XY type (right click on it, choose Chart Type or Change Chart Type, and select the type from the dialog). Excel helpfully (NOT!) adds secondary axes, because nobody could possibly want XY and column series on the same axis. Except us.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep05.png" alt="panel chart step 5" /></p>
<p>In Excel 2003 or earlier, immediately select the other added series, and press the F4 function key to repeat the previous action. In Excel 2007, the F4 key has lost most of its former glory, so you&#8217;ll have to use the right-click approach to change it to an XY type.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep06.png" alt="panel chart step 6" /></p>
<p>Select one of the XY series (&#8216;brand1&#8242; below) and format it so it is on the primary axis.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep07.png" alt="panel chart step 7" /></p>
<p>Select the other XY series, and in Excel 2003 or prior, click F4 again. Excel 2007 users, you know the drill.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep08.png" alt="panel chart step 8" /></p>
<p>Well, that&#8217;s lines up the way we want. Let&#8217;s tidy up, shall we? First, select the legend entry for the &#8216;axis&#8217; series (the text label, not the colored rectangle), and press delete.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep09.png" alt="panel chart step 9" /></p>
<p>Add vertical (X-axis) major gridlines (Chart menu &gt; Chart Options &gt; Gridlines tab in Excel 2003, one of the contextual Chart Tools tabs in 2007). Format them the same gray as the border.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep10.png" alt="panel chart step 10" /></p>
<p>Finally, use formatting to make the brand data stick out a bit. I used brighter colors and a thicker line.</p>
<p align="center"><img src="http://peltiertech.com/WordPress/wp-content/img200811/panelstep11.png" alt="panel chart step 11 - done" /></p>
<p>Not too tricky. We needed a little hint about data arrangement, and one dummy series to handle the X axis labels.</p>
]]></content:encoded>
			<wfw:commentRss>http://peltiertech.com/WordPress/how-to-build-a-simple-panel-chart/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

