Subtypes

Listed below are the different types of graphs that use Stacked Bars.

Vertical Stacked Bar

The graph depicted in Example 13.1 is a Vertical bar graph (i.e. the bars are vertical).

To create a Vertical Stacked bar graph in PopChart XML, you should set the Type attribute of Graph to Bar, and the SubType attribute to Vertical Stacked. The tag below shows how this is done.

<Graph Name='graph' Type='Bar' SubType='Vertical Stacked'>

Horizontal Stacked Bar

Horizontal Stacked Bar graphs are similar to Vertical Stacked Bar graphs, the only difference being that they are rotated 90 degrees. If you have long category or data labels and you don't want to rotate the labels, a Horizontal Stacked Bar graph may be more convenient than a Vertical Stacked Bar graph.

To create a Vertical Stacked bar graph in PopChart XML, you should set the Type attribute of Graph to Bar, and the SubType attribute to Vertical Stacked. The tag below shows how this is done.

<Graph Name='graph' Type='Bar' SubType='Horizontal Stacked'>

Floating Stacked Bar

Both Vertical and Horizontal Stacked Bar graphs can be turned into Floating Stacked Bar graphs. In a Floating Stacked Bar graph, the bottom segment (last data item) in each stacked bar will be invisible. This has the effect of making the bar seem to float. Example 13.4 shows how to use a Floating Stacked Bar graph.


To create a Floating Stacked Bar graph in PopChart XML, simply add a Properties subelement to your Graph element (if it does not already exist). In the Properties subelement, add a FloatingBars attribute and set its value to Yes. The PopChart XML in Example 13.5 below shows how you would turn a Horizontal Stacked Bar graph into a Floating Horizontal Stacked Bar graph.

Example 13.5 Floating Stacked Bar in PopChart XML

<Graph Name='graph' Type='Bar' SubType='Horizontal Stacked'> 

   <Properties FloatingBars='Yes'/> 

</Graph>