# Need help in drawing the following Stacked Bar Graph

I want your help in drawing the following figure. I think it is called as stacked bar graph.

-
Search the pgfplots documentation for "ybar stacked". – erik Apr 12 '13 at 5:50

This type of graph is easy to produce with the pgfplots package. See below for an example. For more details on ybar stacked graphs, see p77 of the pgfplots manual.

You should also consider transforming your ybar stacked graph into an xbar stacked graph (see p78 of the pgfplots manual); those tend to be easier to parse.

EDIT: I have shamelessly adapted Jake's very detailed answer to Center nodes near coords in a stacked ybar plot to add values in the bars:

\documentclass{article}

\usepackage{pgfplots}

1   15  12  03  24  16  19
2   15  12  03  24  16  19
3   15  12  03  24  16  19
4   15  12  03  24  16  19
5   15  12  03  24  16  19
6   15  12  03  24  16  19
}\datatable

\makeatletter
\pgfplotsset{
calculate offset/.code={
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}
\pgfmathsetmacro\testmacro{%
(\pgfplotspointmeta*10^\pgfplots@data@scale@trafo@EXPONENT@y)%
/2*\pgfplots@y@veclength)%
}
\pgfkeys{/pgf/fpu=false}
},
nodes near coords vertically centered/.style={
every node near coord/.append style={
/pgfplots/calculate offset,
yshift=-\testmacro
},
nodes near coords align=center
}
}
\makeatother

\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar stacked,%
bar width=15pt,%
legend style={%
at={(0,0)},%
anchor=west,%
at={(axis description cs:1.05,+0.5)}},%
reverse legend,%
xtick={1,2,...,6},%
xticklabels={1,2,3,4,5,6},%
enlarge x limits=0.1,%
enlarge y limits=false,%
ymin=0,%
ymax=100.01,%
ytick={0,10,...,100},%
yticklabels={0\%,10\%,20\%,30\%,40\%,50\%,60\%,70\%,80\%,90\%,100\%},%
xlabel={\textbf{Company}},%
ylabel={\textbf{\% Distribution of efforts}},%
point meta=explicit,
nodes near coords={\pgfmathprintnumber[fixed zerofill,precision=1]{\pgfplotspointmeta}
},
every node near coord/.style={%
check for zero/.code={ %
\pgfmathfloatifflags{\pgfplotspointmeta}{0}{%
\pgfkeys{/tikz/coordinate}%
}{}%
},%
check for zero,%
fill=white,%
fill opacity=0.75,%
text opacity=1,%
font=\scriptsize,%
inner ysep=0.5pt,%
},%
nodes near coords vertically centered,%
]