# How to plot a bar chart with several bars?

I am trying to plot a bar chart in LaTeX to be displayed as below

and the script I am referring to is as below:

\begin{filecontents}{data.csv}
A,  B,  C,  D
5,  10, 17, 12
10, 9,  27, 21
15, 33, 33, 27
20, 32, 70, 69
25, 32, 102,    60
30, 44, 108,    57
35, 54, 123,    100

\end{filecontents}
\begin{tikzpicture}
\begin{axis}[
ybar,
xlabel={A},
xtick=data,
xticklabels from table={\datatable}{A},
ylabel={}]
\end{axis}
\end{tikzpicture}


but it only displays one bar. I am very new to plotting charts in LaTeX hence any help on this will be much appreciate.

• welcome to tex!se! please help us to help you ... always provide small complete document beginning with \documentclass{... followed by preamble with packages related to your problem and ending with \end{document} which we can copy to our computers and test. – Zarko Jan 23 '18 at 7:51

after convert your code sniped to worked small, complete document ...

for each bar you need add \addplot table [x expr=\coordindex, y=<column name>]{\datatable};:

\documentclass{article}
\usepackage{pgfplots, pgfplotstable}
\pgfplotsset{compat=1.15}

\begin{filecontents}{data.csv}
A,  B,  C,  D
5,  10, 17, 12
10, 9,  27, 21
15, 33, 33, 27
20, 32, 70, 69
25, 32, 102,    60
30, 44, 108,    57
35, 54, 123,    100

\end{filecontents}

\begin{document}
\begin{tikzpicture}
\begin{axis}[width=11cm,
ybar,
bar width=7pt,
xlabel={A},
xtick=data,
xticklabels from table={\datatable}{A},
ymajorgrids,
legend pos=north west
]