I use this to create a Bar Chart:
BarChart[
Reverse@data,
BarOrigin -> Left,
ChartLabels ->
Placed[{Reverse@labels, Reverse@data}, {Before, After}],
ChartElementFunction -> "FadingRectangle"
]
With data = {7, 10, 0, 6, 0, 3, 5}
this gives
The problem is that some of the data values are 0 and BarChart
won't even add labels for them. Instead it leaves a open space. How can I get it to still add the labels even though the values are 0?
This is with Mathematica 8.
BarChart[Reverse[data /. x_ /; x == 0 -> 10^-5], ...
(i.e. replace zeros with small numbers just before plotting). I used the patternx_ /; x == 0
to match both 0 and 0.0 ... I guess 0|0.0 would have been good as well. – Chevrette