Skip to main content
1 of 9
kglr
  • 400.5k
  • 18
  • 488
  • 929

A more flexible chart element function that modifies built-in chart element functions to add thick lines:

ClearAll[ceF]
ceF[cedf_: "GlassRectangle", o : OptionsPattern[]][col_: Black, thickness_: 3] := 
  {ChartElementDataFunction[cedf, o][##], 
   col, AbsoluteThickness[thickness], 
   Line[{{#[[1, 1]], #[[2, 1]]}, {#[[1, 1]], #[[2, 2]]},
         {#[[1, 2]], #[[2, 2]]}, {#[[1, 2]], #[[2, 1]]}}]} &

Examples:

SeedRandom[42];
data = RandomVariate[NormalDistribution[0, 1], 200];

Histogram[data, ChartStyle -> 1, ChartElementFunction -> ceF[][]]

Mathematica graphics

Histogram[data, ChartStyle -> 1, 
 ChartElementFunction -> 
  ceF["FadingRectangle"][Dynamic[Darker@Darker@CurrentValue["Color"]], 5]]

Mathematica graphics

Histogram[data, ChartStyle -> 1, 
 ChartElementFunction -> 
  ceF["FadingRectangle", "GradientOrigin"->Top][Dynamic[Darker@CurrentValue["Color"]], 5]]

Mathematica graphics

kglr
  • 400.5k
  • 18
  • 488
  • 929