# Stacked 2D Chart

## Recommended Posts

I'm not sure if this can be done, but I'm hoping you can help me with a solution.

Scenario:

Four pieces of data include

Bar 1:

Total # of Apples

Total # of Apples Washed (subsection of Total # Apples)

Bar 2

Total # of Apples Assigned to a given Washer

Total # of Apples given Washer has Washed (subset of Total # of Apples Assigned to a given Washer)

I need two bars each showing the max value equal to (and displaying the correct number of) the Total # of Apples (bar 1) and Total # of Apples Assigned to a given Washer (bar 2)

The subsets of each bar (always equal to or smaller than the Totals above) would be the second section of the Stacked 2D chart.

Example:

7 Total Apples

4 Total Apples Washed

4 Total Apples Assigned to a given Washer

2 Total Apples a given Washer has Washed

So the first bar would show 7 as a max value for the Total # of Apples (in Green) and of that 7, 4 (in Blue) have been washed.

The second bar would show 4 as a max value for the Total # of Apples Assigned to a given Washer (in Green) and of that 4, 2 (in Blue) have been washed by the given Washer.

What I'm currently getting is two sections (Green and Blue) being added together showing 11 (7 + 4) Total Apples and 6 (4 + 2) Total Apples Assigned to a Washer

Does this make any sense at all?

Is it possible to do what I want?

Would another chart be a better choice than the Stacked 2D chart?

##### Share on other sites

Hello,

Yes, it is possible to execute this chart.

The Multi-Series stacked column 2D chart would be suitable for your requirements.

But showing 4 washed apples as a subset of total number of apples(7) is not possible. You can try showing it as unwashed apples(3) + washed apples(4)

Hope this helps!

##### Share on other sites

Thank you so much for the response. I'm curious though how you got the Total # of Apples to show up at the top of the bar? Also, is it possible to show the total numbers for each section? Not as a tooltext attribute, but on the bar itself? So 7 would show up at the top of the bar, and 4 would show up at the top of its section (same for the other bar, too).

##### Share on other sites

Hello,

The sum of the number of apples can be displayed on top of the data plot by setting "showSum" attribute in the chart element to 1.

This attribute is used to show sum of all the columns in a given stacked column.

Ref. Code:

<chart .. showSum='1'>

..

</chart>

Also, to display the value of each section, you would simply need to set the "showValues" attribute in the dataset element to 1.

Ref. Code:

<chart ..>

..

<dataset>

<dataset .. showValues='1'>

..

</dataset>

..

</dataset>

</chart>

Hope this helps!

Edited by Chaitra

## Create an account

Register a new account