Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: overlay of stacked bar and line?


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: overlay of stacked bar and line?
Date   Thu, 27 Feb 2014 17:54:04 -0500

Nina,

stacked bar plot is not a twoway graph type. So it would be hard to do this:
http://docs.fusioncharts.com/charts/contents/ChartSS/Images/StackedColumnLine2D.jpg
http://www.anychart.com/products/anychart/docs/articles/Creating%20dashboard%20from%20the%20scratch_files/dashboard-stacked-column-line-combination.jpeg

with a standard set of commands (if the above is what you mean).

It should be possible to do it by overlaying an area plot and a line
plot, but you would need to rewrite the implementation of the stacked
bar plot as an area plot, which is possible, but a rather boring
exercise.

Best, Sergiy.

PS: thinking about a graphics question? Consult the Stata graphs
galleries first:
http://www.stata.com/support/faqs/graphics/gph/stata-graphs/
http://www.survey-design.com.au/Stata%20Graphs.html
http://www.ats.ucla.edu/STAT/stata/library/GraphExamples/default.htm



On Thu, Feb 27, 2014 at 5:24 PM, Nirina F <[email protected]> wrote:
> I am trying to graph a yearly data and the first one below worked but
> not quite what I wanted as I wanted the bar to be stacked.
>
> twoway  bar  y1 y2 y3 y4 year  if year>=2000 || line totalofy1y2 year
> if year>=2000
>
> Then I tried this but I got an error I believe it does not specify the
> overlay....
>
> graph bar (asis)  y1 y2 y3 if year>=2000, over(year) stack || line
> totalofy1y2 year
>
> Is there a new command that does this please?
>
> Nina
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index