A Visio user asked recently about data binding a table like the following as a stacked chart. The question was a little imprecise about how, so I shall present a few alternatives.
Region | Q1 | Q2 | Q3 | Q4 |
Rg1 | 45 | 12 | 35 | 45 |
Rg2 | 12 | 24 | 45 | 36 |
Rg3 | 78 | 36 | 45 | 71 |
Firstly, I entered the table in Sheet1 of a new Excel workbook and saved it.
Pivot Diagram
I inserted a Pivot Diagram based on the worksheet, and broke it down by the Category Region. I then modified the Data Graphics to display the Q1, Q2, Q3 and Q4 values as Stacked bar 1, Multi-bar graph, Stacked bar 2 as graphic items. Of course, I wouldn’t use all three in reality, but it serves to demonstrate the capability.
Link Data to Shapes
Next, I linked the worksheet as an External Data recordset, and dragged out each row onto the page. Again, I then modified the Data Graphics to display the Q1, Q2, Q3 and Q4 values as Stacked bar 1, Multi-bar graph, Stacked bar 2 as graphic items.
3-D bar graph
Lastly, I dragged and dropped a 3-D bar graph shape from the the Business \ Charts and Graphs \ Charting Shapes stencil. Then I used the the Define Shape Data dialog to change the labels for Bar 1 value, Bar 2 value, Bar 3 value and Bar 4 value to Q1, Q2, Q3 and Q4. This enabled me to drag and drop a row from the External Data window onto the shape, and the values from the Q1, Q2, Q3 and Q4 columns populated the existing Shape Data fields, and a new row, labelled Region, was created. I changed the Bar count property to 4 and the Range to 100, then used Insert \ Field to update the text with the Prop._VisDM_Region property. I duplicated the shape twice, and replaced the link on each with one of the other rows from the External Data window.
Finally, I added the 3-D axis shape to the page and sent it to back, before arranging all four shapes prettily.
Conclusion
I have been able to demonstrate several ways in which a Stacked bar chart can be created from linked data in Visio, without going to the trouble of creating custom shapes. Of course, this is always an option…..
Doug Taylor says
I have Visio Professional 2010 but can’t find any reference to multi-bar (stacked) graphs. Is that an add-on that you used, or is that buried somewhere in the Visio capabilities? Your screen shots seem to show many more capabilities than my version (which is 14.0.6106.5005). Thanks.
davidjpp says
The Multi-bar graph, Stacked bar 1 and Stacked bar 2 are the last thre items on the drop-down for the Data Bar Styles in the Data Graphis dialog.