({{, (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) 
is an option for charting functions such as (RefLink[BarChart, paclet:ref/BarChart]) that gives a function to use to generate the primitives for rendering each chart element.}})

OpenersNotesSection(Spacer1)Details

(RefLink[ChartElementFunction, paclet:ref/ChartElementFunction])->f specifies that each chart element should be rendered with the graphics primitives given by f[region,values,metadata].

(RefLink[ChartElementFunction, paclet:ref/ChartElementFunction])->"name" uses a named function for generating chart elements.

Lists of built-in named functions for specific charting functions can be obtained from ChartElementData["BarChart"], etc.

In (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction])->f, the region argument to f is given as follows:

In (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction])->f, the values argument to f is given as follows:

In the case of (RefLink[Histogram, paclet:ref/Histogram]) and (RefLink[Histogram3D, paclet:ref/Histogram3D]) the values given are those in the sublist of data associated with each bin.

With input data of form {(Subscript[d, 1])->(Subscript[m, 1]),(Subscript[d, 2])->(Subscript[m, 2]),…} the metadata associated with (Subscript[d, i]) is {(Subscript[m, i])}. With input data of the form {{(Subscript[d, 1])->(Subscript[m, 1]),(Subscript[d, 2])->(Subscript[m, 2]),…},…}->(Subscript[m, 0]) the metadata associated with (Subscript[d, i]) is {(Subscript[m, 0]),(Subscript[m, i])}.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Use a built-in (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]):

ChartElementData["BarChart"]

BarChart[{{1,2,3},{4,5,6}},ChartElementFunction->"GlassRectangle"]

ChartElementData["PieChart3D"]

PieChart3D[{1,2,3,4,5},ChartElementFunction->"ProfileSector3D",SectorOrigin->{Automatic,1},ChartStyle->"Rainbow"]

Construct a custom rendering function:

g[{{xmin_,xmax_},{ymin_,ymax_}},___]:=Polygon[{{xmin,ymin},{xmax,ymax},{xmin,ymax},{xmax,ymin}}]

BarChart[{1,2,3,4,5},ChartElementFunction->g]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ChartElements, paclet:ref/ChartElements])  ▪  (RefLink[ColorFunction, paclet:ref/ColorFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Financial Visualization, paclet:guide/FinancialVisualization])}, {▪(RefLinkPlain[Chart Styling & Layout, paclet:guide/ChartLayoutAndStyling])}, {▪(RefLinkPlain[Charting and Information Visualization, paclet:guide/ChartingAndInformationVisualization])}, {▪(RefLinkPlain[Statistical Visualization, paclet:guide/StatisticalVisualization])}})}})