Peltier Tech Blog

Excel Chart Add-Ins | Training | Custom Solutions | Charts and Tutorials | PTS Blog

 

Main menu:

 
Peltier Tech
Chart Add-Ins

Peltier Tech Waterfall Chart Utility
Peltier Tech Cluster-Stack Chart Utility
Peltier Tech Box and Whisker Chart Utility
Peltier Tech Marimekko Chart Utility
Peltier Tech Dot Plot Utility
Peltier Tech Cascade Chart Utility

 
Excel Dashboards

Subscribe

Site search

Subscribe

Site search


Recent Posts

Recently Commented

Popular Posts

Archive


 

Categories


 

Privacy Policy

Creative Commons License
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Category Axis Tricks for Line and Area Charts – 2

by Jon Peltier
Sunday, June 8th, 2008
Peltier Technical Services, Inc., Copyright © 2010.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

In Category Axis Tricks for Line and Area Charts – 1, we saw how to use two line series to create a two-toned line chart. This is useful if we want to differentiate between actual values up to a certain date and predicted values thereafter, or if we want to distinguish values from different periods of time. This is relatively easy to do for a line chart by distributing the data into two columns, where both series have the same number of category values, and the Y values for each series are lined up with the corresponding category values.

 

 

Red Blue
1 11
2 7
3 12
4 7
5 15 15
6 13
7 16
8 12
9 17
10 16
11 18

 

 

The line chart works fine, one series starting where the other leaves off. Area charts, on the other hand, don’t work as well. Looking at the two series individually, we see that both have colored regions between categories 4 and 6.


In the stacked version of the chart, the colored areas stack one atop the other, so that the total extends above the top of the chart. In the unstacked version, one area is drawn in front of the other.

In Line Chart vs. Step Chart, we saw that two points with the same category value are plotted on the same vertical line if the line chart uses a date-scale axis. We need to duplicate the point where the two series meet, denoted by the two rows in the table below with green text.

 

 

Red Blue
1 11 0
2 7 0
3 12 0
4 7 0
5 15 0
5 0 15
6 0 13
7 0 16
8 0 12
9 0 17
10 0 16
11 0 18

 

 

For illustration purposes I have not yet converted the category axis from category to date-scale; note the dual “5″ axis tick labels, colored green. Plotted separately, notice that both area series have a colored region between the two “5″ category labels, one sloping down to zero, the other sloping up from zero.

The stacked area chart ends up with a constant sum between the two “5″ labels, while hte unstacked again shows one area drawn in front of the other.

When the category axis is converted to a time-scale axis, the dual “5″ categories are brought into coincidence, and the sloping lines become vertical. The area series are drawn separately so the vertical border are clearly shown.

When the two area chart series are plotted in the same chart, they now meet at a vertical boundary. This behavior can be used to generate custom background shading effects.

Related Posts:

Bookmark and share this entry:
  • Twitter
  • Digg
  • Facebook
  • LinkedIn
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Google Bookmarks
  • Reddit
  • MySpace
  • Slashdot
  • Yahoo! Buzz
  • Tumblr

Learn how to create Excel dashboards.

Write a comment

I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.

If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.

Read the PTS Blog Comment Policy.





Subscribe without commenting

Peltier Tech Waterfall Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

Create Excel dashboards quickly with Plug-N-Play reports.