2

How can I change the background colour of a bchart? In this case it appears a blue nuance (I guess it's the standard).

\documentclass[10pt,a4paper,roman]{article}
\usepackage{bchart}
\usepackage{graphicx}
\begin{document}
\begin{bchart}[step=100,max=200]
\bcbar[text=Bule,value=19419]{194.19}
\bcbar[text=Inserție,value=19513]{195.13}
\bcbar[text=Shell,value=19513]{195.13}
\bcbar[text=Interclasare,value=19517]{195.17}
\bcbar[text=Rapidă,value=19525]{195.25}
\bcbar[text=Selecție,value=19537]{195.37}
\end{bchart}
\end{document}
0

1 Answer 1

3

You can use the color option for \bcbar as in the following example. But you should consider using a different approach for data visualization for better distinction between the entries.

diagram

\documentclass[10pt,a4paper,roman]{article}
\usepackage{bchart}
\usepackage{graphicx}
\begin{document}
\begin{bchart}[step=100,max=200]
\bcbar[text=Bule,value=19419,color=green]{194.19}
\bcbar[text=Inserție,value=19513,color=blue]{195.13}
\bcbar[text=Shell,value=19513,color=yellow]{195.13}
\bcbar[text=Interclasare,value=19517,color=red]{195.17}
\bcbar[text=Rapidă,value=19525,color=pink]{195.25}
\bcbar[text=Selecție,value=19537,color=orange]{195.37}
\end{bchart}
\end{document}
1
  • 1
    No criticism to the answer, that is perfect (+1), but I cannot resist a off-topic comment about the result: The graph is now a rainbow tablecloth as unclear as before. The problem in this graph (of course, IMO, the OP has the right of think differently) is not the color but the x-scale. Hiding the decimals values does not help either . Instead, some like\begin{bchart}[step=1,min=193,max=196] \bcbar[text=Bule]{194.19} ... seems to me clearer and more elegant.
    – Fran
    Sep 16, 2017 at 4:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .