Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

ChartElements

ChartElements
is an option to charting functions such as BarChart that specifies the graphics to use as the basis for bars or other chart elements.

DetailsDetails

  • Elements in charts can be based on any Graphics, Graphics3D, or Image object.
  • The final rendered form of each chart element is obtained by replicating or stretching copies of the base object so as to fill the necessary shape or region.
  • The following settings for ChartElements can be used:
  • Noneleave chart elements blank
    Automaticuse a preset default graphic
    gfill chart elements with copies of g
    {g,All}stretch a single g to fill each chart element
    {g,{w,h}}use copies of g with width w and height h
    {g1,g2,}use for the i^(th) element in each dataset
    {spec1,spec2,}use different specifications for different data dimensions
  • With a chart element specification of the form , the following width and height specifications can be given:
  • sexplicit size in ordinary plot coordinates
    Scaled[s]size given as a fraction of the chart element region
    Automaticsize determined by the original aspect ratio of g
    Allsize that fills the chart element region
  • Settings for ImageSize and AspectRatio in g are ignored when rendering chart elements, except when w or h is Automatic.
  • When objects g are rendered for chart elements, their base styles are inherited from the styles defined for each chart element.
  • Settings for BarOrigin and similar options do not affect either the orientation in which objects g are rendered or the identification of w and h as width and height.
  • With ChartElements->{g1,g2,}, the are used cyclically to render the chart elements for successive elements in each dataset.
  • With ChartElements->{spec1,spec2,}, the are used as chart element specifications for successive dimensions in nested lists of datasets.
  • ChartElements->{g1,g2,} is effectively taken to give a specification for the innermost dimension of nested lists of datasets.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Create a pictorial chart based on any Graphics object:

In[1]:=
Click for copyable input
Out[1]=

Graphics3D:

In[2]:=
Click for copyable input
Out[2]=

Image:

In[3]:=
Click for copyable input
Out[3]=

Create 3D pictorial bars:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
Introduced in 2008
(7.0)