Update: A simpler custom chart element function:
ClearAll[CEF]
CEF[cedf_ : {"Rectangle"}, op_ : .5] :=
{Opacity[op], EdgeForm[],
(ChartElementData @@ cedf)[{#[[1, 1]] + {0, 1},
Charting`ChartStyleInformation["BoundingBox"][[2]]}, ##2],
Opacity[1], EdgeForm[Gray], HatchFilling[45 Degree, 3, 10],
ChartElementData["Rectangle"][##]} &;
Examples:
dat = {2, -1, .05, -3, 3, 2.5};
BarChart[dat,
ImageSize -> 600,
GridLines -> {None, Automatic},
ChartStyle -> 61,
BarSpacing -> 2,
"BarStartingValue" -> 0,
Axes -> {False, True},
ChartElementFunction -> CEF[],
Epilog -> {GrayLevel[.4], AbsoluteThickness[.2],
Line[{{0, 0}, {Length @ data, 0}}]}]

Use BarSpacing -> 1
and replace CEF[]
with CEF[{"FadingRectangle", "GradientOrigin"->Right}]
to get

Original answer:
dat = {2, -1, .05, -3, 3, 2.5};
An alternative approach using HatchFilling
as in Edmund's answer and a custom ChartElementFunction
to add background fillings:
backgroundCEF[cedf_ : "Rectangle"] :=
ChartElementData[cedf][{#[[1, 1]] + {0, 1},
Charting`ChartStyleInformation["BoundingBox"][[2]]}, ##2] &;
Note: For this chart element function to work properly, we need to add the (undocumented) option "BarStartingValue" -> 0
in BarChart[...]
so that the horizontal coordinates of rectangles are successive integer pairs starting at 0.
Examples:
We can use backgroundCEF
in two ways:
- Create a separate bar chart with the option
ChartElementFunction -> backgroundCEF[]
and
combine it with the original bar chart using Show
, or
- Use the graphics primitives of the bar chart created with
backgroundCEF[]
as Prolog
in the original bar chart:
Show[BarChart[dat, ImageSize -> 600,
ChartStyle -> 61,
ChartBaseStyle -> HatchFilling[],
BarSpacing -> 2,
"BarStartingValue" -> 0,
Axes -> {False, True}],
BarChart[dat, ImageSize -> 600,
ChartStyle -> 61,
ChartBaseStyle -> Directive[EdgeForm[], FaceForm[Opacity[.2]]],
ChartElementFunction -> backgroundCEF[],
BarSpacing -> 2,
"BarStartingValue" -> 0],
Prolog -> {Line[{#, Scaled[{1, 0}, #]} & @ {0, 0}]}]

BarChart[dat, ImageSize -> 600,
ChartStyle -> 61,
ChartBaseStyle -> HatchFilling[],
BarSpacing -> 2,
"BarStartingValue" -> 0,
Axes -> {False, True},
PlotRange -> {{0, Length@dat}, All},
Prolog -> {Line[{#, Scaled[{1, 0}, #]} & @ {0, 0}],
First @ BarChart[dat,
ChartStyle -> 61,
ChartBaseStyle -> Directive[EdgeForm[], FaceForm[Opacity[.2]]],
ChartElementFunction -> backgroundCEF[],
BarSpacing -> 2,
"BarStartingValue" -> 0]}]

Replace FaceForm[Opacity[.2]]
with FaceForm[Opacity[.4]]
and use backgroundCEF["FadingRectangle]
to get

Use backgroundCEF["GlassRectangle]
to get
