Yes, I have to say it, I don’t build charts too often. And because of that, sometimes it’s hard to remember how did I do it last time. Stacked charts is one of those examples. It’s been a few months since the last time I built one, and I just got asked a few questions that sent be back scrambling to figure out how to do it.
First off, what are stacked charts?
A stacked chart, looking like the image below, is a representation of parts in a whole. Very generically stated.
The chart describes the cases by origin for each day. So, the whole is the day, while the parts are the case origins. This could have been a single bar for the current day, or a set of bars for multiple days like the example shown.
So, now that we see the purpose, what available options do we have for representation?
Starting with the previous article HERE, we can adjust colors, labels, and other properties of the chart by modifying the XML. But let’s leave that as a last option, and look first at what we can do out of the box.
The example presented above shows a simple stacked chart. We can actually modify it to make it into a 100% Stacked Column chart. That is very easy to achieve by going to the chart properties, and changing the type of chart to 100% Stacked Column.
NOTE: You can not modify a default chart, you have to save it as new and then modify it.
The end result will look like the above screenshot. Of course, make sure that it makes sense to represent the data as such.
Now, pay attention to which charts support this functionality. Just like I mentioned above, making sure the data represented makes sense, some chart types do not make sense to have a stacked option. The ones supporting stacking are:
- Column Type Charts
- Bar Type Charts
- Area Type Charts
Bonus Brownie Points
Editing the XML allows us to change this chart and show it in 3D. Export the chart XML, and find the <presentationdescription> tag. Underneath, locate the <ChartArea> and right before the closing tag of </ChartArea> add the following line:
<Area3DStyle Enable3D="True" LightStyle="Simplistic" />
Re-import the XML as a new chart. And now, your shiny new 3D chart will look like so:
Cool, eh? Now go ahead and stack’em high.
Enjoy!
Leave a Reply