Hello I have the following data,
I'm creating the following bar graph:
I want to stack some data, hence why I included the stack option, however I only want to stack 'emp1' and 'emp2' together and seperately 'emp3' and 'emp4' together. So two stacked bars in each year. Not all four of them stacked together as currently, which is producing only one stacked bar in each year.
Any ideas how to implement this?
Thanks,
Jad
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year float(emp1 emp2 emp3 emp4) 2000 8.287 349.506 62.41 456.367 2001 7.862 427.525 69.546 598.399 2002 16.165 611.199 75.528 744.512 2003 11.914 777.101 87.031 897.903 2004 18.107 944.163 83.388 1076.389 2005 22.732 1100.708 115.292 1210.571 2006 20.412 1316.654 134.195 1365.223 2007 31.985 1526.965 168.284 1547.406 2008 25.674 1658.5 154.205 1680.176 2009 21.161 1739.472 140.922 1790.8 2010 28.375 1957.499 217.189 1889.972 2011 43.873 2267.242 167.622 2083.245 2012 32.195 2429.847 146.445 2084.692 2013 39.729 2697.61 124.509 2163.135 2014 32.863 3020.331 147.221 2248.292 2015 27.374 3376.271 151.724 2393.775 2016 39.595 3708.233 108.538 2611.653 end
I'm creating the following bar graph:
Code:
* draw graph for first decomposition (continuers & exiters) graph bar emp1 emp2 emp3 emp4, over(year,label(labsize(small) angle(45)) gap(20)) stack /// bar(1, color(navy*0.8)) bar(2, color(navy)) bar(3, color(green)) bar(4, color(dkgreen)) graphregion(color(white)) /// ytitle("Manufacturing Employment (k workers)") /// legend(on label(1 "Foreign exiters") label(2 "Foreign continuers") /// label(3 "Private exiters") label(4 "Private continuers") /// region(lstyle(foreground)) rows(1) position(6) span) outergap(10)
Any ideas how to implement this?
Thanks,
Jad
Comment