I am having trouble writing a code that produces a stacked bar chart where the "total" value for the bar is the sum of the values in my data frame. For example, I have my data in the following format:
amount types years
7753547 Funding 2015
7370817 Funding 2016
4140110 Expenses 2015
4209865 Expenses 2016
I really want a stacked bar chart where the x-axis is the year, fill is by types, and the "total" is the funding amount and the bar is partitioned by expenses. So, for example, in 2015, the bar goes up to 7.7 million and then is partitioned off at 4.14 million. Any suggestions would be great. I've been attempting to find some code but to no avail. Thank you.
Funding
row for that year, then you don't really want the sum of the values, you want the values represented as they currently are without summing. Can you clarify? – Marius