You can use a custom ChartElementDataFunction
as follows:
cedF[{{xmin_, xmax_}, {ymin_, ymax_}}, ___] :={If[xmax <= 8,
RGBColor[1, 0, 0], Sequence[]],
Dynamic@EdgeForm[Directive[Thickness[.015], Lighter@CurrentValue["Color"]]],
Rectangle[{xmin, ymin}, {xmax, ymax}, RoundingRadius -> 5]};
Histogram[RandomVariate[NormalDistribution[10, 2], 500],ChartStyle -> "Pastel",
ChartElementFunction -> cedF]
EDIT: Adding arguments to cedf
:
cedf2[from_,to_,color_: Red, t_:Small, rr_: 0][{{xmin_, xmax_}, {ymin_, ymax_}}, ___] :=
{If[from < xmax <= to, color, Sequence[]],
Dynamic@EdgeForm[Directive[Thickness[t], Lighter@CurrentValue["Color"]]],
Rectangle[{xmin, ymin}, {xmax, ymax}, RoundingRadius -> rr]}
Histogram[RandomVariate[NormalDistribution[10, 2], 500], ChartStyle -> "Pastel",
ChartElementFunction -> cedf2[6, 10, Purple, Small, 3]]
Alternatively, you can build a custom data function using the built-in ChartElementDataFunctions
:
sgmntsclF = ChartElementDataFunction["SegmentScaleRectangle",
"Segments" -> 8, "ColorScheme" -> "TemperatureMap"];
grdntrctF = ChartElementDataFunction["GradientRectangle",
"ColorScheme" -> "Rainbow", "GradientOrigin" -> Top];
Histogram[RandomVariate[NormalDistribution[10, 2], 500], ChartStyle -> "Pastel",
ChartElementFunction -> ((If[7 < #[[1, 2]] <= 10, sgmntsclF[##], grdntrctF[##]]) &)]
HistogramList
and plot it withBarChart
-- I don't haveHistogramList
in v7 or I'd make this an answer. $\endgroup$