Sub series in stacked bar plot

Two series will be shown in a bar plot. Additionally, they contain sub series, which we would like to plot in the same diagram. So we just need a 2D plot. We will shift the series to achieve that.

Stacked bar plot

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.8}
\colorlet{xcolorA}{red!80!black}
\colorlet{xcolorB}{orange}
\colorlet{ycolorA}{blue}
\colorlet{ycolorB}{blue!40!white}
\begin{document}
\begin{tikzpicture}
  \pgfplotsset{ybar stacked, ymin=0, ymax=100, xmin=0.5, xmax=2.5, xtick=data}
  \begin{axis}[bar shift=-8pt,
    legend pos = outer north east, legend style = {name = serieA}]
    \addplot [fill=xcolorA] table [x index = 0, y index = 1] {serieA.dat};
    \addplot [fill=ycolorA] table [x index = 0, y index = 2] {serieA.dat};
    \legend{x (Serie A), y (Serie A)}
  \end{axis}
  \begin{axis}[bar shift = 8pt,
    legend style = {at = {([yshift = -1mm]serieA.south west)},
      anchor = north west}]
    \addplot [fill = xcolorB] table [x index = 0, y index = 1] {serieB.dat};
    \addplot [fill = ycolorB] table [x index = 0, y index = 2] {serieB.dat};
    \legend{x (Serie B), y (Serie B)}
  \end{axis}
\end{tikzpicture}
\end{document}
Click to download: sub-series-in-stacked-bar-plot.texsub-series-in-stacked-bar-plot.pdf