Mathematica > Visualization and Graphics > Charting and Information Visualization >
Mathematica > Visualization and Graphics > Data Visualization > Charting and Information Visualization >

BarChart

BarChart[{y1, y2, ...}]
makes a bar chart with bar lengths y1, y2,....
BarChart[{..., wi[yi, ...], ..., wj[yj, ...], ...}]
makes a bar chart with bar features defined by the symbolic wrappers wk.
BarChart[{data1, data2, ...}]
makes a bar chart from multiple datasets datai.
  • Data elements for BarChart can be given in the following forms:
yia pure bar value
wi[yi,...]a bar with value yi and wrapper wi
formi->mia bar form with metadata mi
  • data not given in these forms is taken to be missing, and typically yields a gap in the bar chart.
  • Datasets for BarChart can be given in the following forms:
{e1,e2,...}list of elements with or without wrappers
w[{e1,e2,...},...]wrapper applied to a whole dataset
w[{data1,data1,...},...]wrapper applied to all datasets
  • The following wrappers can be used for chart elements:
Annotation[e,label]provide an annotation
Button[e,action]define an action to execute when the element is clicked
EventHandler[e,...]define a general event handler for the element
Hyperlink[e,uri]make the element act as a hyperlink
Labeled[e,...]display the element with labeling
Legended[e,...]include features of the element in a chart legend
Mouseover[e,over]make the element show a mouseover form
PopupWindow[e,cont]attach a popup window to the element
StatusArea[e,label]display in the status area when the element is moused over
Style[e,opts]show the element using the specified styles
Tooltip[e,label]attach an arbitrary tooltip to the element
Top,Bottom,Left,Right,Centerpositions within bars
Above, Below, Before, Afterpositions outside bars
Axison the bar origin axis
{{bx,by},{lx,ly}}scaled position {lx, ly} in the label at scaled position {bx, by} in the bar
  • BarChart has the same options as Graphics with the following additions and changes:
AspectRatio1/GoldenRatiooverall ratio of width to height
AxesTruewhether to draw axes
BarOriginBottomorigin placement for bars
BarSpacingAutomaticfractional spacing between bars
ChartBaseStyleAutomaticoverall style for bars
ChartElementFunctionAutomatichow to generate raw graphics for bars
ChartElementsAutomaticgraphics to use in each of the bars
ChartLabelsNonelabels for data elements and datasets
ChartLayoutAutomaticoverall layout to use
ChartLegendsNonelegends for data elements and datasets
ChartStyleAutomaticstyle for bars
ColorFunctionAutomatichow to color bars
ColorFunctionScalingTruewhether to normalize arguments to ColorFunction
JoinedFalsewhether to join bars
LabelingFunctionAutomatichow to label bars
LegendAppearanceAutomaticoverall appearance of legends
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
  • Possible settings for ChartLayout include "Grouped", "Stacked", "Stepped" and "Percentile".
  • The arguments supplied to ChartElementFunction are the bar region {{xmin, xmax}, {ymin, ymax}}, the data value yi, and metadata {m1, m2, ...} from each level in a nested list of datasets.
  • A list of built-in settings for ChartElementFunction can be obtained from ChartElementData["BarChart"].
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team