% This file is embedded in datatool-user.pdf version 3.4.2 2025-11-06
% Example 142 Bar Chart Cycling through the Colour Set
% Label: "ex:barchartcyclecols"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
% sample CSV file:
\begin{filecontents}[noheader,overwrite]{fruit.csv}
Name,Quantity
"Apples",30
"Pears",25
"Lemons,Limes",40.5
"Peaches",34.5
"Cherries",20
\end{filecontents}


\usepackage{databar}
% Load data from fruit.csv file:
\DTLsetup{store-datum,default-name=fruit}
\DTLread{fruit.csv} 
\begin{document}
\DTLbarchart
{
 variable=\Quantity,% variable required
 bar-label=\Name,
 pre-init={\DTLclearbarcolors},
 bar-colors={cyan,magenta,yellow},
 color-style=cycle,
}
{fruit}% database
{\Quantity=Quantity,\Name=Name}% assignment list
 
\end{document}
