How to force two or more tikzpictures to be below each other in standalone class?

You can simply use a tabular:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}

\begin{tabular}{@{}c@{}}
\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,
  ]        
  \end{axis}
\end{tikzpicture}

\\

\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,    
  ]   
  \end{axis}
\end{tikzpicture}

\end{tabular}

\end{document}

enter image description here


Like so, one page but one chart on top of the other? (Simply add varwidth class option, as suggested by Torbjørn.)

\documentclass[varwidth]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}

%\vbox{% <-- redundant, thanks to `varwidth' class option
\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,
  ]
  \end{axis}
\end{tikzpicture}

\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,
  ]
  \end{axis}
\end{tikzpicture}
%}

\end{document}

Or, on separate pages?

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}

\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,
  ]
  \end{axis}
\end{tikzpicture}

\begin{tikzpicture}
  \begin{axis}[
    axis y line=left,
    axis x line=middle,
    width=12cm,
    height=3cm,
  ]
  \end{axis}
\end{tikzpicture}

\end{document}