Date: Feb 18, 2013 6:00 AM
Author: Alexei Boulbitch
Subject: barchart

Dear Group:

I have not managed to combine BarChart with a line.

The simple problem is the following. I have a labeled BarChart (that is, I
use the ChartLegends options) , and I want to draw a horizontal line, to highlight the separation say between units below and above 10. But I do not see how can this be done within BarChart, and I haven't been able to combine BarChart with the line using Show or Graphics.

Can somebody help me?

Francisco


Hi, Francisco,

It was not quite clear to me what is it, that you wish to achieve. If you mean that the line should cross
The bar chart itself, try this:

bch = BarChart[Range[8], ChartStyle -> "DarkRainbow",
ChartLegends -> {"1", "2", "3", "4", "5", "6", "7", "8"}];
Show[{
bch,

Graphics[{Line[{{0, 5}, {10, 5}}]}]

If you need that one of the legend items would be highlighted, try this:

BarChart[Range[8], ChartStyle -> "DarkRainbow",
ChartLegends -> {"1", "2", "3", "4",
Row[{"5",
Graphics[{Arrowheads[1], Arrow[{{1, 1}, {0., 1}}]},
ImageSize -> {20, 40}]}], "6", "7", "8"}]

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu