({{, (RefLink[RectangleChart, paclet:ref/RectangleChart])[{{(Subscript[x, 1]),(Subscript[y, 1])},{(Subscript[x, 2]),(Subscript[y, 2])},…}] 
makes a rectangle chart with bars of width (Subscript[x, i]) and height (Subscript[y, i]). }, {, (RefLink[RectangleChart, paclet:ref/RectangleChart])[{…,(Subscript[w, i])[{(Subscript[x, i]),(Subscript[y, i])},…],…,(Subscript[w, j])[{(Subscript[x, i]),(Subscript[y, j])},…],…}]
makes a rectangle chart with bar features defined by the symbolic wrappers (Subscript[w, k]).}, {, (RefLink[RectangleChart, paclet:ref/RectangleChart])[{(Subscript[data, 1]),(Subscript[data, 2]),…}]
makes a rectangle chart from multiple datasets (Subscript[data, i]). }})

OpenersNotesSection(Spacer1)Details and Options

Data elements for (RefLink[RectangleChart, paclet:ref/RectangleChart]) can be given in the following forms:

Data not given in these forms is ignored in forming the rectangle chart.

Datasets for (RefLink[RectangleChart, paclet:ref/RectangleChart]) can be given in the following forms:

The following wrappers can be used for chart elements:

In (RefLink[RectangleChart, paclet:ref/RectangleChart]), (RefLink[Labeled, paclet:ref/Labeled]), (RefLink[Callout, paclet:ref/Callout]) and (RefLink[Placed, paclet:ref/Placed]) allow the following positions:

(RefLink[RectangleChart, paclet:ref/RectangleChart]) has the same options as (RefLink[Graphics, paclet:ref/Graphics]) with the following additions and changes:

Possible settings for (RefLink[ChartLayout, paclet:ref/ChartLayout]) include "Grouped" and "Stepped".

The arguments supplied to (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) are the bar region {{(Subscript[x, min]),(Subscript[x, max])},{(Subscript[y, min]),(Subscript[y, max])}}, the data value {(Subscript[x, i]),(Subscript[y, i])}, and metadata {(Subscript[m, 1]),(Subscript[m, 2]),…} from each level in a nested list of datasets.

A list of built-in settings for (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) can be obtained from ChartElementData["RectangleChart"].

The arguments supplied to (RefLink[ColorFunction, paclet:ref/ColorFunction]) consist of (Subscript[x, i]) and (Subscript[y, i]).

Style and other specifications from options and other constructs in (RefLink[RectangleChart, paclet:ref/RectangleChart]) are effectively applied in the order (RefLink[ChartStyle, paclet:ref/ChartStyle]), (RefLink[ColorFunction, paclet:ref/ColorFunction]), (RefLink[Style, paclet:ref/Style]) and other wrappers, (RefLink[ChartElements, paclet:ref/ChartElements]), and (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]), with later specifications overriding earlier ones.

OpenersPrimaryExamplesSection(Spacer1)Examples  (129)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Generate a rectangle chart for a list of width and height pairs:

RectangleChart[{{1,1},{1,2},{2,3}}]

Multiple datasets:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}}]

Use categorical labels:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

RectangleChart[data,ChartLabels->{"a","b","c"}]

Categorical legends:

RectangleChart[data,ChartLegends->{"a","b","c"}]

Set the style for bars:

RectangleChart[Tuples[{1,2},2],ChartStyle->"DarkRainbow"]

Pictorial bars:

RectangleChart[Tuples[{1,2},2],ChartElements->{,{All,1}}]

Procedural bars:

RectangleChart[Tuples[{1,2},2],ChartElementFunction->"GlassRectangle",ChartStyle->"Pastel"]

OpenersExampleSection1(Spacer1)Scope  (39)

OpenersExampleSubsection0(Spacer1)Data and Layouts  (12)

Items in a dataset are grouped together:

RectangleChart[{{{1,1},{1,1},{1,1}},{{2,2},{2,2},{2,2}}}]

Datasets do not need to have the same number of items:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}}]

Non-real data is taken to be missing:

RectangleChart[{{{1,1},Missing[],{1,1},{1,1}},{{2,2},1+I,{2,2}},{foo,{3,3}}}]

The data may include units:

RectangleChart[{{(QuantityUnit[3]),(QuantityUnit[2])},{(QuantityUnit[8]),(QuantityUnit[5])},{(QuantityUnit[2]),(QuantityUnit[3])},{(QuantityUnit[1]),(QuantityUnit[3])},{(QuantityUnit[8]),(QuantityUnit[7])},{(QuantityUnit[7]),(QuantityUnit[1])}},AxesLabel->Automatic,BarSpacing->None,Ticks->True]

Specify the units to use:

RectangleChart[{{(QuantityUnit[3]),(QuantityUnit[2])},{(QuantityUnit[8]),(QuantityUnit[5])},{(QuantityUnit[2]),(QuantityUnit[3])},{(QuantityUnit[1]),(QuantityUnit[3])},{(QuantityUnit[8]),(QuantityUnit[7])},{(QuantityUnit[7]),(QuantityUnit[1])}},AxesLabel->Automatic,BarSpacing->None,Ticks->True,TargetUnits->{"Minutes","Feet"}]

The time stamps in (RefLink[TimeSeries, paclet:ref/TimeSeries]), (RefLink[EventSeries, paclet:ref/EventSeries]), and (RefLink[TemporalData, paclet:ref/TemporalData]) are ignored:

RectangleChart[TimeSeries[{{19,16},{9,3},{7,2},{17,5}},{"May 24, 1982"}]]

The values in associations are taken as the dimensions of the bars:

RectangleChart[<|"a"->{1,1},"b"->{1,2},"c"->{2,1},"d"->{2,2}|>]

Use the keys as labels:

RectangleChart[<|"a"->{1,1},"b"->{1,2},"c"->{2,1},"d"->{2,2}|>,ChartLabels->Automatic]

Use the keys as callouts:

RectangleChart[<|"a"->{1,1},"b"->{1,2},"c"->{2,1},"d"->{2,2}|>,ChartLabels->Callout[Automatic,Above]]

Use the keys as legends:

RectangleChart[<|"a"->{1,1},"b"->{1,2},"c"->{2,1},"d"->{2,2}|>,ChartLegends->Automatic,ChartStyle->99]

Associations can be nested:

RectangleChart[<|"group a"-><|"a"->{1,2},"b"->{2,1}|>,"group b"-><|"a"->{1,1},"b"->{2,2}|>|>,ChartLegends->Automatic]

The weights in (RefLink[WeightedData, paclet:ref/WeightedData]) are ignored:

RectangleChart[WeightedData[{{1,1},{2,1},{3,2},{4,3},{5,5}},{0.5,0.2,0.1,0.2,0.3}]]

Use different layouts to display multiple datasets:

Table[RectangleChart[Tuples[{1,2},2],ChartLayout->l],{l,{"Grouped","Stepped"}}]

Control the origin of bars:

Table[RectangleChart[{{1,1},{1,2},{2,3}},BarOrigin->o,PlotLabel->o],{o,{Bottom,Left,Top,Right}}]

Adjust the spacing between bars and groups of bars:

Table[RectangleChart[Tuples[{1,2},2],BarSpacing->s,PlotLabel->s,ChartStyle->Opacity[0.8]],{s,{Automatic,{0,1},{-0.3,1}}}]

OpenersExampleSubsection1(Spacer1)Wrappers  (5)

Use wrappers on individual data, datasets, or collections of datasets:

{RectangleChart[{{{1,1},Style[{1,2},Red],{2,3}},{{1,1},{2,1}}}],RectangleChart[{Style[{{1,1},{1,2},{2,3}},Green],{{1,1},{2,1}}}],RectangleChart[Style[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},Blue]]}

Wrappers can be nested:

{RectangleChart[{{{1,1},Style[{1,2},Red],{2,3}},{{1,1},{2,1}}}],RectangleChart[{Style[{{1,1},Style[{1,2},Red],{2,3}},Green],{{1,1},{2,1}}}],RectangleChart[Style[{Style[{{1,1},Style[{1,2},Red],{2,3}},Green],{{1,1},{2,1}}},Blue]]}

Override the default tooltips:

RectangleChart[{{1,1},Tooltip[{1,2},"median"],{2,3}}]

Use any object in the tooltip:

RectangleChart[Table[Tooltip[{CountryData[c,"Population"],CountryData[c,"GDPPerCapita"]},CountryData[c,"Flag"]],{c,CountryData["G8"]}],BarSpacing->0]

Use (RefLink[PopupWindow, paclet:ref/PopupWindow]) to provide additional drilldown information:

RectangleChart[{{1,1},PopupWindow[{1,2},DateListPlot[FinancialData["IBM","Jan. 1, 2004"]]],{2,3}}]

(RefLink[Button, paclet:ref/Button]) can be used to trigger any action:

RectangleChart[{{1,1},Button[{1,2},Speak[2]],{2,3}}]

OpenersExampleSubsection2(Spacer1)Styling and Appearance  (9)

Use an explicit list of styles for the bars:

RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->{Red,Green,Blue}]

Use any gradient or indexed color schemes from (RefLink[ColorData, paclet:ref/ColorData]):

{RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->"Pastel"],RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->12]}

Use color schemes designed for charting:

ColorData["Charting"]

Table[RectangleChart[Tuples[{1,2,3,4},2],ChartStyle->i,Axes->None],{i,ColorData["Charting"][[1;;4]]}]

Alter the appearance of charts with built-in themes:

{RectangleChart[{{1,1},{1,2},{2,3}},PlotTheme->"Marketing"],RectangleChart[{{1,1},{1,2},{2,3}},PlotTheme->"Detailed"]}

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) can be used to set an initial style for all chart elements:

RectangleChart[{{1,1},{1,2},{2,3}},ChartBaseStyle->EdgeForm[Dashed],ChartStyle->45]

(RefLink[Style, paclet:ref/Style]) can be used to override styles:

RectangleChart[{{1,1},{1,2},Style[{3,4},Red],{2,3}},ChartStyle->Gray]

Use any graphic for pictorial bars:

{RectangleChart[{{1,1},{1,2},{2,3}},ChartElements->Graphics[Disk[]]],RectangleChart[{{1,1},{1,2},{2,3}},ChartElements->ExampleData[{"TestImage","House"}]]}

Use built-in programmatically generated bars:

ChartElementData["RectangleChart"]

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartElementFunction->f,ChartStyle->"Pastel"],{f,{"FadingRectangle","GlassRectangle"}}]

For detailed settings use Palettes ▶ ChartElementSchemes:

RectangleChart[{{1,1},{1,2},{2,3}},ChartElementFunction->ChartElementDataFunction["SegmentScaleRectangle","Segments"->7,"ColorScheme"->"SolarColors"]]

Use a theme with detailed frame ticks and grid lines:

RectangleChart[{{{1,1},{1,2},{2,3}},{{2,1},{1,2}}},PlotTheme->"Detailed"]

Use a theme with a high-contrast color scheme and edge-fading rectangles:

RectangleChart[{{{1,1},{1,2},{2,3}},{{2,1},{1,2}}},PlotTheme->"Marketing"]

OpenersExampleSubsection3(Spacer1)Labeling and Legending  (13)

Use (RefLink[Labeled, paclet:ref/Labeled]) to add a label to a bar:

RectangleChart[{{1,1},Labeled[{1,2},"label"],{2,3}}]

Use symbolic positions for label placement:

Table[RectangleChart[{{1,1},Labeled[{1,2},"label",p],{2,3}},PlotLabel->p,Ticks->None],{p,{Bottom,Center,Top}}]

Table[RectangleChart[{{1,1},Labeled[{1,2},"label",p],{2,3}},BarOrigin->Left,PlotLabel->p,Ticks->None],{p,{Left,Center,Right}}]

Provide categorical labels for the columns of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLabels->{"c1","c2","c3"}]

For rows of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLabels->{{"r1","r2"},None}]

For both:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLabels->{{"r1","r2"},{"c1","c2","c3"}}]

Use (RefLink[Placed, paclet:ref/Placed]) to control the positioning of labels, using the same positions as for (RefLink[Labeled, paclet:ref/Labeled]):

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLabels->{Placed[{"r1","r2"},Above],Placed[{"c1","c2","c3"},Center]}]

Use (RefLink[Callout, paclet:ref/Callout]) to add a label to a bar:

RectangleChart[{{1,1},{1,2},Callout[{2,3},"label"]}]

Change the appearance of the callout:

RectangleChart[{{1,1},{1,2},Callout[{2,3},"label",Appearance->"Balloon"]}]

Automatically position callouts:

RectangleChart[Table[Callout[RandomReal[{1,5},2],Unique["text"]],5]]

Provide value labels for bars by using (RefLink[LabelingFunction, paclet:ref/LabelingFunction]):

RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->Above]

Use (RefLink[Placed, paclet:ref/Placed]) to control placement and formatting:

labeler[v_,{i_,j_},{ri_,cj_}]:=Placed[Column[{v,ri[[1]],cj[[1]]},","],Center]

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLabels->{{"r1","r2"},{"c1","c2","c3"}},LabelingFunction->labeler]

Generate callouts from the data:

RectangleChart[{{1,4},{5,5},{1,1},{4,1},{2,3}},LabelingFunction->(Callout[Style[Times@@#,10+5Max[#]],Above]&)]

Add categorical legend entries for the columns of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLegends->{"ccc1","ccc2","ccc3"},ChartStyle->"Pastel"]

For rows of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLegends->{{"rr1","rr2"},None},ChartStyle->{"Pastel",None}]

Use (RefLink[Legended, paclet:ref/Legended]) to add additional legend entries:

RectangleChart[{{{1,1},Legended[{1,2},"extra"],{2,3}},{{1,1},{2,1}}},ChartStyle->"Pastel",ChartLegends->{"aaa","bbb","ccc"}]

Use (RefLink[Placed, paclet:ref/Placed]) to affect the positioning of legends:

Table[RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartLegends->Placed[{"ccc1","ccc2","ccc3"},p],ChartStyle->"Pastel"],{p,{Before,Below}}]

OpenersExampleSection2(Spacer1)Options  (69)

OpenersExampleSubsection4(Spacer1)BarOrigin  (1)

Change the bar origin:

Table[RectangleChart[Tuples[{1,2},2],BarOrigin->o,PlotLabel->o],{o,{Top,Bottom,Left,Right}}]

OpenersExampleSubsection5(Spacer1)BarSpacing  (5)

Use automatically determined spacing between bars:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},BarSpacing->Automatic]

Use no spacing:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},BarSpacing->None]

Use symbolic presets:

Table[RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},BarSpacing->s,PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

Use explicit spacing between bars:

Table[RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},BarSpacing->s,ChartStyle->Opacity[0.8],PlotLabel->s],{s,{Automatic,1,-0.3}}]

Use explicit spacing between bars and groups of bars:

Table[RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},BarSpacing->s,PlotLabel->s],{s,{Automatic,{0,1},{0,0.2}}}]

OpenersExampleSubsection6(Spacer1)ChartBaseStyle  (5)

Use (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) to style all bars:

RectangleChart[{{1,1},{1,2},{2,3}},ChartBaseStyle->EdgeForm[Dashed]]

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartBaseStyle->EdgeForm[Dashed]]

RectangleChart[{{1,1},{1,2},{2,3}},BarSpacing->-0.3,ChartBaseStyle->Opacity[0.7]]

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) combines with (RefLink[ChartStyle, paclet:ref/ChartStyle]):

RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->24,ChartBaseStyle->EdgeForm[Dashed]]

(RefLink[ChartStyle, paclet:ref/ChartStyle]) may override settings for (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]):

RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->EdgeForm[None],ChartBaseStyle->EdgeForm[Dashed]]

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) combines with (RefLink[Style, paclet:ref/Style]):

RectangleChart[{{1,1},Style[{1,2},Yellow],{2,3}},ChartBaseStyle->EdgeForm[Dashed]]

(RefLink[Style, paclet:ref/Style]) may override settings for (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]):

RectangleChart[{{1,1},Style[{1,2},EdgeForm[None]],{2,3}},ChartBaseStyle->EdgeForm[Dashed]]

(RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]) combines with (RefLink[ColorFunction, paclet:ref/ColorFunction]):

RectangleChart[{{1,1},{1,2},{2,3}},ChartBaseStyle->EdgeForm[Dashed],ColorFunction->Function[{x,y},ColorData["Pastel"][x*y]]]

(RefLink[ColorFunction, paclet:ref/ColorFunction]) may override settings for (RefLink[ChartBaseStyle, paclet:ref/ChartBaseStyle]):

RectangleChart[{{1,1},{1,2},{2,3}},ChartBaseStyle->EdgeForm[Dashed],ColorFunction->(EdgeForm[None]&)]

OpenersExampleSubsection7(Spacer1)ChartElements  (9)

Create a pictorial chart based on any (RefLink[Graphics, paclet:ref/Graphics]) object:

RectangleChart[Tuples[{1,2},2],ChartElements->Graphics[Disk[]]]

(RefLink[Graphics3D, paclet:ref/Graphics3D]):

RectangleChart[Tuples[{1,2},2],ChartElements->Graphics3D[Sphere[]]]

(RefLink[Image, paclet:ref/Image]):

RectangleChart[Tuples[{1,2},2],ChartElements->ExampleData[{"TestImage","House"}]]

Use a stretched version of the graphic:

RectangleChart[Tuples[{1,2},2],ChartElements->{,All}]

Use explicit sizes for width and height:

Table[RectangleChart[Tuples[{1,2},2],ChartElements->{Graphics[Disk[],AspectRatio->Full],s},PlotLabel->s],{s,{{1/2,1},{1,1/2}}}]

Without (RefLink[AspectRatio, paclet:ref/AspectRatio])->(RefLink[Full, paclet:ref/Full]), the original aspect ratio is preserved:

Table[RectangleChart[Tuples[{1,2},2],ChartElements->{Graphics[Disk[]],s},PlotLabel->s],{s,{{1/2,1},{1,1/2}}}]

Using (RefLink[All, paclet:ref/All]) for width or height causes that direction to stretch to the full size of the bar:

Table[RectangleChart[Tuples[{1,2},2],ChartElements->{,s},PlotLabel->s],{s,{{1/2,All},{All,1/2}}}]

Use a different graphic for each column of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartElements->{,,}]

Use a different graphic for each row of data:

RectangleChart[{{{1,1},{1,2},{2,3}},{{1,1},{2,1}}},ChartElements->{{,},None}]

Graphics are used cyclically:

RectangleChart[Tuples[{1,2},2],ChartElements->{{,All},{,All}}]

Styles are inherited from styles set through (RefLink[ChartStyle, paclet:ref/ChartStyle]) etc:

RectangleChart[Tuples[{1,2},2],ChartElements->,ChartStyle->"Pastel"]

Explicit styles set in the graphic will override other style settings:

RectangleChart[Tuples[{1,2},2],ChartElements->,ChartStyle->"Pastel"]

The orientation of the pictorial graphic is unaffected by (RefLink[BarOrigin, paclet:ref/BarOrigin]):

Table[RectangleChart[Tuples[{1,2},2],ChartElements->,BarOrigin->o],{o,{Bottom,Top,Left,Right}}]

Create true 3D shaded bars:

g=Graphics3D[{EdgeForm[],Specularity[White,30],Cylinder[]},ViewPoint->{0,-Infinity,0},Boxed->False,Lighting->"Neutral",PlotRangePadding->0];

RectangleChart[Tuples[{1,2},2],ChartElements->{g,All}]

OpenersExampleSubsection8(Spacer1)ChartElementFunction  (5)

Get a list of built-in settings for (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]):

ChartElementData["RectangleChart"]

For detailed settings use Palettes ▶ ChartElementSchemes:

Table[RectangleChart[Tuples[{1,2},2],ChartElementFunction->f,ChartStyle->"Pastel",PlotLabel->f],{f,{"Rectangle","ObliqueRectangle"}}]

Table[RectangleChart[Tuples[{1,2},2],ChartElementFunction->f,ChartStyle->"Pastel",PlotLabel->f],{f,{"FadingRectangle","GlassRectangle"}}]

Here is a (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) appropriate to show the global scale:

Table[RectangleChart[Tuples[{1,2},2],ChartElementFunction->f,ChartStyle->"Pastel",PlotLabel->f],{f,{"GradientScaleRectangle","SegmentScaleRectangle"}}]

Write a custom (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]):

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

RectangleChart[Tuples[{1,2},2],ChartElementFunction->f]

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

RectangleChart[Tuples[{1,2},2],ChartElementFunction->g]

Use metadata passed on from the input, in this case charting the data:

DataDrilldownBar[{{xmin_,xmax_},{ymin_,ymax_}},y_,{data_List}]:=
PopupWindow[Polygon[{{xmin,ymin},{xmax,ymax},{xmin,ymax},{xmax,ymin}}],PieChart[data]]

DataDrilldownBar[{{xmin_,xmax_},{ymin_,ymax_}},y_,_]:=
Rectangle[{xmin,ymin},{xmax,ymax}]

RectangleChart[{{1,1}->Range[5],{1,2},{2,1}->RandomReal[1,10]},ChartElementFunction->DataDrilldownBar]

OpenersExampleSubsection9(Spacer1)ChartLabels  (8)

By default, labels are placed in the axis:

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->{"a","b","c"}]

(RefLink[Labeled, paclet:ref/Labeled]) wrappers in data will place additional labels:

RectangleChart[{{1,1},Labeled[{1,2},"label",Center],{2,3}},ChartLabels->{"a","b","c"}]

Use (RefLink[Placed, paclet:ref/Placed]) to control label placement:

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"a","b","c"},p],PlotLabel->p,Ticks->None],{p,{Bottom,Center,Top}}]

Positions outside the bar:

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"a","b","c"},p],PlotLabel->p,Ticks->None],{p,{Below,Above}}]

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"a","b","c"},p],BarOrigin->Left,PlotLabel->p,Ticks->None],{p,{Before,After}}]

Coordinate-based placement relative to a bar:

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"aa","bb","cc"},p],BarSpacing->0.5,Ticks->None,PlotLabel->p],{p,{{0,0},{1/2,1/2},{1,1}}}]

Place all labels at the upper-right corner and vary the coordinates within the label:

Table[RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[Framed/@{"aa","bb","cc"},{{1,1},p}],BarSpacing->0.8,Ticks->None,PlotLabel->p],{p,{{0,0},{1/2,1/2},{1,1}}}]

Use the third argument to (RefLink[Placed, paclet:ref/Placed]) to control formatting:

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"aaa","bbb","ccc"},Center,Rotate[#,45Degree]&]]

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"aaa","bbb","ccc"},Center,Panel[#,FrameMargins->0]&]]

Use a hyperlink label:

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"aaa","bbb","ccc"},Center,Hyperlink[#,"http://www.wolfram.com"]&]]

Rotate the labels:

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{"aaa","bbb","ccc"},Axis,Rotate[#,Pi/4]&]]

By default, labels are associated with columns of data:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

{RectangleChart[data,ChartLabels->{"c1","c2","c3"}],
RectangleChart[data,ChartLabels->{None,{"c1","c2","c3"}}]}

Associate labels with rows or datasets:

RectangleChart[data,ChartLabels->{{"r1","r2"},None}]

Label both rows and columns:

RectangleChart[data,ChartLabels->{{"r1","r2"},{"c1","c2","c3"}}]

Use (RefLink[Placed, paclet:ref/Placed]) to affect placements:

RectangleChart[data,ChartLabels->{Placed[{"r1","r2"},Below],Placed[{"c1","c2","c3"},Center]}]

Use (RefLink[Callout, paclet:ref/Callout]) to connect the labels to the bars:

RectangleChart[{{1,5},{8,4},{6,7}},ChartLabels->Callout[{"c1","c2","c2"},Automatic]]

Place multiple labels:

RectangleChart[{{1,1},{1,2},{2,3}},ChartLabels->Placed[{{"a","b","c"},{"x","y","z"}},{Top,Bottom}]]

OpenersExampleSubsection10(Spacer1)ChartLayout  (1)

(RefLink[ChartLayout, paclet:ref/ChartLayout]) is grouped by default:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

RectangleChart[data]

Use stepped bars:

RectangleChart[data,ChartLayout->"Stepped"]

OpenersExampleSubsection11(Spacer1)ChartLegends  (4)

Generate a legend based on chart style:

RectangleChart[{{1,1},{1,2},{2,3}},ChartStyle->"Pastel",ChartLegends->{"John","Mary","Bob"}]

Use (RefLink[Legended, paclet:ref/Legended]) to add additional legend entries:

RectangleChart[{{1,1},Legended[{1,2},"Henry"],{2,3}},ChartStyle->"Pastel",ChartLegends->{"John","Mary","Bob"}]

Or to specify individual legend entries:

RectangleChart[{{1,1},Legended[{1,2},"Henry"],{2,3}},ChartStyle->"Pastel"]

Generate a legend for datasets:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

RectangleChart[data,ChartLegends->{{"Group A","Group B"},None},ChartStyle->{"Pastel",None}]

Unused legend labels are dropped:

RectangleChart[data,ChartLegends->{{"Group A","Group B","Group C"},None},ChartStyle->{"Pastel",None}]

Legends can be applied to several dimensions:

RectangleChart[data,ChartLegends->{{"Test A","Test B"},{"John","Mary","Bob"}},ChartStyle->{{EdgeForm[Thick],EdgeForm[Dashed]},"Pastel"}]

Use (RefLink[Placed, paclet:ref/Placed]) to control the placement of legends:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

Table[RectangleChart[data,ChartLegends->Placed[{"John","Mary","Bob"},pos],ChartStyle->"Pastel"],{pos,{Before,Below}}]

OpenersExampleSubsection12(Spacer1)ChartStyle  (7)

Use (RefLink[ChartStyle, paclet:ref/ChartStyle]) to style bars:

Table[RectangleChart[Tuples[{1,2},2],ChartStyle->s],{s,{Green,EdgeForm[Dashed],Directive[Green,EdgeForm[Dashed]]}}]

Give a list of styles:

RectangleChart[Tuples[{1,2},2],ChartStyle->{Red,Green,Blue,Yellow}]

Use gradient colors from (RefLink[ColorData, paclet:ref/ColorData]):

RectangleChart[Tuples[{1,2},2],ChartStyle->"Pastel"]

Use indexed colors from (RefLink[ColorData, paclet:ref/ColorData]):

RectangleChart[Tuples[{1,2},2],ChartStyle->24]

Styles are used cyclically:

RectangleChart[Tuples[{1,2},2],ChartStyle->{Red,Green}]

Style each column of data:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

RectangleChart[data,ChartStyle->{Red,Green,Blue}]

Style each row of data:

RectangleChart[data,ChartStyle->{{Red,Green},None}]

Style both rows and columns of data:

RectangleChart[data,ChartStyle->{{EdgeForm[Dotted],EdgeForm[Dashed]},{Red,Green,Blue}}]

With both row and column styles, the last style may override earlier ones:

RectangleChart[data,ChartStyle->{{Yellow,Magenta},{Red,Green,Blue}}]

(RefLink[Style, paclet:ref/Style]) overrides settings for (RefLink[ChartStyle, paclet:ref/ChartStyle]):

RectangleChart[{{1,1},Style[{1,3},Yellow],{3,2}},ChartStyle->{Red,Green,Blue}]

RectangleChart[{{1,1},Style[{1,3},EdgeForm[Dashed]],{3,2}},ChartStyle->{Red,Green,Blue}]

(RefLink[ColorFunction, paclet:ref/ColorFunction]) overrides settings for (RefLink[ChartStyle, paclet:ref/ChartStyle]):

RectangleChart[Tuples[{1,2},2],ChartStyle->{Red,Green,Blue,Brown},ColorFunction->"SolarColors"]

RectangleChart[Tuples[{1,2},2],ChartStyle->EdgeForm/@{Dashed,Dotted,DotDashed},ColorFunction->(Blend[{LightBlue,LightRed},#]&)]

(RefLink[ChartElements, paclet:ref/ChartElements]) with explicit style settings override settings for (RefLink[ChartStyle, paclet:ref/ChartStyle]):

RectangleChart[Tuples[{1,2},2],ChartElements->,ChartStyle->"Pastel"]

OpenersExampleSubsection13(Spacer1)ColorFunction  (4)

Color by bar height:

RectangleChart[Table[{Exp[-t^2],Exp[-t^2]},{t,-2,2,0.25}],ColorFunction->Function[{width,height},ColorData["Rainbow"][height]]]

Use (RefLink[ColorFunctionScaling, paclet:ref/ColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled height values:

RectangleChart[Tuples[{1,2},2],ColorFunction->(Switch[{#1,#2},{1,1},Yellow,{1,2},Orange,{2,1},Red,_,Blue]&),ColorFunctionScaling->False]

Color by area:

RectangleChart[{{1,1},{1,2},{2,1},{2,2}},ColorFunction->Function[{width,height},ColorData["Rainbow"][width height/4]],ColorFunctionScaling->False]

(RefLink[ColorFunction, paclet:ref/ColorFunction]) overrides styles in (RefLink[ChartStyle, paclet:ref/ChartStyle]):

RectangleChart[Tuples[{1,2,3},2],ChartStyle->{Red,Green,Brown},ColorFunction->"Pastel"]

Use (RefLink[ColorFunction, paclet:ref/ColorFunction]) to combine different style effects:

RectangleChart[Table[{Exp[-t^2],Exp[-t^2]},{t,-2,2,0.25}],ColorFunction->Function[{width,height},Opacity[height]],ChartStyle->Purple]

OpenersExampleSubsection14(Spacer1)ColorFunctionScaling  (2)

Use (RefLink[ColorFunctionScaling, paclet:ref/ColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled height values:

RectangleChart[Tuples[{1,2},2],ColorFunction->(Switch[{#1,#2},{1,1},Yellow,{1,2},Orange,{2,1},Red,_,Blue]&),ColorFunctionScaling->False]

Color by area:

RectangleChart[{{1,1},{1,2},{2,1},{2,2}},ColorFunction->Function[{width,height},ColorData["Rainbow"][width height/4]],ColorFunctionScaling->False]

OpenersExampleSubsection15(Spacer1)LabelingFunction  (8)

Use automatic labeling by values through (RefLink[Tooltip, paclet:ref/Tooltip]) and (RefLink[StatusArea, paclet:ref/StatusArea]):

RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->Automatic]

Do no labeling:

RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->None]

Use (RefLink[Placed, paclet:ref/Placed]) to control label placement:

Table[RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->(Placed[#,p]&),PlotLabel->p,Ticks->None],{p,{Bottom,Center,Top}}]

Symbolic positions outside the bar:

Table[RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->(Placed[#,p]&),PlotLabel->p,Ticks->None],{p,{Below,Above}}]

Table[RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->(Placed[#,p]&),BarOrigin->Left,PlotLabel->p,Ticks->None],{p,{Before,After}}]

Coordinate-based placement relative to a bar:

Table[RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->(Placed[#,p]&),BarSpacing->0.5,Ticks->None,PlotLabel->p],{p,{{0,0},{1/2,1/2},{1,1}}}]

Use (RefLink[Callout, paclet:ref/Callout]) to place labels automatically:

RectangleChart[{{3,5},{8,4},{6,7}},LabelingFunction->(Callout[Row[#,"⊗"],Automatic]&)]

Use symbolic positions to place (RefLink[Callout, paclet:ref/Callout]) labels:

Table[RectangleChart[{{3,5},{8,4},{6,7}},LabelingFunction->(Callout[#,p]&)],{p,{Above,Below}}]

Control the formatting of labels:

RectangleChart[{{1,1},{1,2},{2,3}},LabelingFunction->(Placed[Row[#,"to"],Above]&)]

Use the given chart labels as arguments to the labeling function:

data={{{1,1},{1,2},{2,3}},{{1,1},{2,1}}};

RectangleChart[data,ChartLabels->{{"r1","r2"},{"c1","c2","c3"}},LabelingFunction->(Placed[Column[{#3[[1,1]],#3[[2,1]],#1},","],Center]&),ImageSize->Medium]

Place complete labels as tooltips:

RectangleChart[data,ChartLabels->{{"r1","r2"},{"c1","c2","c3"}},LabelingFunction->(Placed[Row[{#3[[1,1]],#3[[2,1]],#1},","],Tooltip]&)]

OpenersExampleSubsection16(Spacer1)LabelingSize  (4)

Textual labels are shown at their actual sizes:

RectangleChart[{{1,1},{1,2},{2,3},{3,2}},ChartLabels->{"healthfulness","obstreperous","spectrogram","pandemonium"}]

Image labels are automatically resized:

RectangleChart[{{1,1},{1,2},{2,3},{3,2}},ChartLabels->{,,,}]

Specify a maximum size for textual labels:

RectangleChart[{{1,1},{1,2},{2,3},{3,2}},ChartLabels->{"healthfulness","obstreperous","spectrogram","pandemonium"},LabelingSize->50]

Specify a maximum size for image labels:

RectangleChart[{{1,1},{1,2},{2,3},{3,2}},ChartLabels->{,,,},LabelingSize->25]

Show image labels at their natural sizes:

RectangleChart[{{1,1},{1,2},{2,3},{3,2}},ChartLabels->Placed[{,,,},Above],LabelingSize->Full,ImageSize->Medium]

OpenersExampleSubsection17(Spacer1)PerformanceGoal  (3)

Generate a bar chart with interactive highlighting:

RectangleChart[Tuples[{1,2,3},2],PerformanceGoal->"Quality"]

Emphasize performance by disabling interactive behaviors:

RectangleChart[Tuples[{1,2,3},2],PerformanceGoal->"Speed"]

Typically, less memory is required for non-interactive charts:

Table[ByteCount@RectangleChart[Tuples[{1,2,3},2],PerformanceGoal->p],{p,{"Quality","Speed"}}]

OpenersExampleSubsection18(Spacer1)PlotTheme  (1)

Use a theme with detailed frame ticks and grid lines:

RectangleChart[{{5,1},{3,3},{2,4}},PlotTheme->"Detailed"]

Turn off the grid lines:

RectangleChart[{{5,1},{3,3},{2,4}},PlotTheme->"Detailed",GridLines->None]

OpenersExampleSubsection19(Spacer1)TargetUnits  (2)

Units are automatically detected:

RectangleChart[{{(QuantityUnit[3]),(QuantityUnit[2])},{(QuantityUnit[8]),(QuantityUnit[5])},{(QuantityUnit[2]),(QuantityUnit[3])},{(QuantityUnit[1]),(QuantityUnit[3])},{(QuantityUnit[8]),(QuantityUnit[7])},{(QuantityUnit[7]),(QuantityUnit[1])}},AxesLabel->Automatic,BarSpacing->None,Ticks->True]

Specify the units to show in each direction:

RectangleChart[{{(QuantityUnit[3]),(QuantityUnit[2])},{(QuantityUnit[8]),(QuantityUnit[5])},{(QuantityUnit[2]),(QuantityUnit[3])},{(QuantityUnit[1]),(QuantityUnit[3])},{(QuantityUnit[8]),(QuantityUnit[7])},{(QuantityUnit[7]),(QuantityUnit[1])}},AxesLabel->Automatic,BarSpacing->None,Ticks->True,TargetUnits->{"Minutes","Feet"}]

OpenersExampleSection3(Spacer1)Applications  (12)

Move the slider to see how the left Riemann sum of sin(x) in [0,π] approaches (∫_0^π)sin(x)dx=2:

Manipulate[Show[RectangleChart[{Pi/n,#}&/@Sin[Range[0,Pi-Pi/n,Pi/n]],BarSpacing->0,PlotLabel->NumberForm[Pi/n*Total[N@Sin@Range[0,Pi-Pi/n,Pi/n]],4]],Plot[Sin[x],{x,0,Pi}]],{n,5,100}]

Create an overlapped proportional area chart:

data={35,28,10};

RectangleChart[Table[ConstantArray[Sqrt[d],2],{d,data}],BarSpacing->{0,0},ChartLayout->"Overlapped",ChartLabels->Placed[data,{0.94,0.92}]]

Create a rectangle chart of the atomic weight and abundance of elements in the Earth's crust:

data=Cases[Table[Tooltip[QuantityMagnitude@{ElementData[e,"CrustAbundance"],ElementData[e,"AtomicWeight"]},e],{e,ElementData[]}],Tooltip[{c_?NumericQ,a_?NumericQ},_]/;c>0.01&&a>0.01];

Mouse over the bars to get the element names:

RectangleChart[data,BarSpacing->{0,0},ChartStyle->"SandyTerrain"]

Compare sales and profitability:

totalSales={38,24,20,18};
profitability={13,23,7,11};
data=Transpose[{totalSales,profitability}];
options={BarOrigin->Left,BarSpacing->{0,0},ChartLabels->Placed[{"Product A","Product B","Product C","Product D"},Center],AxesLabel->{"Profitability (%)","Total Sales (%)"}};

RectangleChart[data,options]

Label the exact values on the y axis:

labeler[{x_,y_},___]:=Placed[Row[{y,"%"}],Before]

RectangleChart[data,options,LabelingFunction->labeler,Ticks->{Automatic,None}]

Click the bars to hear the name of the country, its GDP per capita, and population:

countries={"Sweden","Luxembourg","Estonia","Portugal","Bulgaria","Slovenia","Austria"};
properties={"Population","GDPPerCapita"};

data=Table[With[{v=cp},Button[v[[2;;3]],Speak[StringJoin[ToString/@{v[[1]],", Population: ",Round[v[[2]]],", GDP per capita: $",Round[v[[3]]]}]]]],{cp,Table[Prepend[Table[CountryData[c,p],{p,properties}],c],{c,countries}]}];

RectangleChart[data,AxesLabel->properties,ChartLabels->Placed[countries,Tooltip],BarSpacing->{0,0.01}]

Create a rectangle chart of average hourly earnings of persons employed on works projects:

data=({{13, 40, "goods"}, {3, 42, "sanitation and health"}, {34, 46, "highways, roads, and streets"}, {5, 47, "conservation"}, {4, 48, "miscellaneous"}, {9, 51, "sewer systems and other utilities"}, {2, 52, "airports and other transportation"}, {9, 57, "parks and other recreation facilities"}, {9, 65, "public buildings"}, {12, 68, "white collar"}});
avgEarnings=Mean[data[[All,2]]];
avgLine={Dashed,Text["Average for All Types",{25,avgEarnings},{0,-1}],Line[{{0,avgEarnings},{100,avgEarnings}}]};

RectangleChart[data[[All,1;;2]],ChartLabels->Placed[data[[All,3]],Center,Rotate[#,Pi/2]&],BarSpacing->{0,0},Frame->True,Epilog->avgLine,FrameLabel->{Column[{"Percent of Total Hours on Which Payment Was Based","100% = 1,976,000,000 Hours"},Alignment->Center],"Average Earnings in Dollars per Hour"}]

Create a chart of the proportion of the working population covered by insurance:

inputData=({{5.8, 95.8, "Extraction of Minerals and Forestry"}, {28.4, 90.3, "Manufacturing and Mechanical Industries"}, {15.4, 62.7, "Trade"}, {5.7, 62.7, "Unspecified Industries and Services"}, {9.1, 48.4, "Transportation and Communication"}, {9.8, 32.6, "Domestic and Personal Service"}, {7.0, 32.4, "Professional Service"}, {22.8, 3, "Agriculture, Fishing, and Public Service"}});

data=Table[Insert[d,100-d[[2]],3],{d,inputData}];

Clear@labeler
labeler[{x_,y_},{r_,1},___]:=Placed[{x,y},{Before,Center}]
labeler[{x_,y_},{r_,c_},___]:=Placed[y,Center]

RectangleChart[Partition[#,2]&/@data[[All,{1,2,1,3}]],ChartLabels->{Placed[data[[All,3]],Tooltip],None},ChartStyle->{LightGray,LightRed},LabelingFunction->labeler,BarOrigin->Left,ChartLayout->"Stacked",BarSpacing->{0,0.01},AxesLabel->{None,"% of Total\nWorking Force"},ChartLegends->Placed[{"% Covered","% Not Covered"},Below]]

Visualize units sold and where they were sold:

domesticSales={58,22,10,35};
exportSales={12,59,50,27};
intercompanySales={30,19,40,48};
units={98,27,48,77};
products={"Product A","Product B","Product C","Product D"};
data=Table[Labeled[{{units[[i]],domesticSales[[i]]},{units[[i]],exportSales[[i]]},{units[[i]],intercompanySales[[i]]}},products[[i]],After],{i,Length[units]}];

RectangleChart[data,BarOrigin->Left,BarSpacing->None,ChartLayout->"Percentile",AxesLabel->{"Percent","Units"},ChartLegends->Placed[{"Domestic sales","Export sales","Intercompany sales"},Above]]

Compare GDP per capita to population among a list of European countries:

countries={"Luxembourg","Estonia","Sweden","Portugal","Bulgaria","Slovenia","Austria"};
properties={"GDPPerCapita","Population"};
data=Table[CountryData[c,p],{c,countries},{p,properties}];

tooltipLabel[v_,{r_,c_},___]:=Placed[Grid[{{countries[[c]]},{"GDPPerCapita",v[[1]]},{"Population",v[[2]]}},Alignment->Left],Tooltip]

Mouse over the rectangles to get a summary for each country:

RectangleChart[data,LabelingFunction->tooltipLabel,ChartStyle->61,AxesLabel->properties,ChartLegends->Placed[countries,Below],ImageSize->400]

Mouse over the rectangles to get a summary for each country:

countries={"Canada","France","Italy","Germany","Japan","Russia","UnitedKingdom"};
gdp=CountryData[#,{"GDP",2006}]&/@countries;
gdpPerCapita=CountryData[#,{"GDPPerCapita",2006}]&/@countries;
population=CountryData[#,{"Population",2006}]&/@countries;
data=Transpose[{gdp,population}];
legends=gdpPerCapita;

RectangleChart[data,LabelingFunction->(Placed[#,Tooltip,Style[Column[{Row[{"GDP (x-axis) : $",First@#}],Row[{"Population (y-axis) : ",Last@#}],Row[{"GDP Per Capita : $",First@#/Last@#}]},Alignment->{Left,Bottom},Frame->True],14,FontFamily->"Helvitica"]&]&),ChartStyle->2,ChartLabels->Placed[countries,Below,Rotate[Style[#,12,FontFamily->"Helvitica",Darker@Brown],Pi/2]&],PlotLabel->Style["Visualizing GDP per Capita",14,Bold,FontFamily->"Helvitica",Darker@Brown],PlotRange->All,ChartLegends->Placed[SwatchLegend[legends,LegendLayout->"Column"],After]]

Visually screen companies by comparing earnings and PE ratios:

companies={"AAPL","MSFT","GOOG","INTC","CSCO","JPM","BAC","GS","WFC","MCD","PEP","GIS","MRK","PFE","GSK","XOM","PSX","OXY","SLB"};
properties={"EarningsPerShare","PERatio"};
data=Table[FinancialData[c,p],{c,companies},{p,properties}];

Define a labeling function to place company information in a tooltip:

tooltipLabel[v_,{r_,c_},___]:=Placed[Grid[{{FinancialData[companies[[c]],"Name"]},{"Earnings",v[[1]]},{"PE Ratio",v[[2]]}},Alignment->Left],Tooltip]

Mouse over the bars to get company information:

RectangleChart[data,BarSpacing->{0,0},LabelingFunction->tooltipLabel,ChartStyle->24,AxesLabel->properties,ImageSize->500]

Create bar codes:

digitToBarWidths[0]={3,2,1,1};
digitToBarWidths[1]={2,2,2,1};
digitToBarWidths[2]={2,1,2,2};
digitToBarWidths[3]={1,4,1,1};
digitToBarWidths[4]={1,1,3,2};
digitToBarWidths[5]={1,2,3,1};
digitToBarWidths[6]={1,1,1,4};
digitToBarWidths[7]={1,3,1,2};
digitToBarWidths[8]={1,2,1,3};
digitToBarWidths[9]={3,1,1,2};
digitToBarWidths["Invert"]={1,1,1,1,1};
digitToBarWidths["Start"]={1,1,1};
digitToBarWidths["Stop"]={1,1,1};

barWidths[upc_List]:=Module[{midpt=Floor[Length[upc]/2]},digitToBarWidths/@Flatten[{"Start",Take[upc,midpt],"Invert",Drop[upc,midpt],"Stop"}]]

makeBarCode[upc_String]:=makeBarCode[ToExpression/@Characters[upc]]
makeBarCode[upc_List]:=RectangleChart[Table[{w,1},{w,Flatten[barWidths[upc]]}],BarSpacing->{0,0},ChartBaseStyle->EdgeForm[],ChartStyle->{Black,White},Axes->None,PlotLabel->Row[upc]]

makeBarCode["812686001109"]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

Use (RefLink[RectangleChart3D, paclet:ref/RectangleChart3D]) to get a 3D rendering of a (RefLink[RectangleChart, paclet:ref/RectangleChart]):

{RectangleChart[{{1,1},{1,2},{2,3}}],RectangleChart3D[{{1,1,1},{1,1,2},{2,1,3}}]}

(RefLink[BarChart, paclet:ref/BarChart]) is a special case of (RefLink[RectangleChart, paclet:ref/RectangleChart]):

{BarChart[{1,2,3}],RectangleChart[{{1,1},{1,2},{1,3}}]}

Use (RefLink[SectorChart, paclet:ref/SectorChart]) to visualize a list of data as sectors:

{RectangleChart[{{1,1},{1,2},{2,3}}],SectorChart[{{1,1},{1,2},{2,3}}]}

Use (RefLink[Histogram3D, paclet:ref/Histogram3D]) to automatically compute binning and draw histograms:

Histogram3D[RandomReal[NormalDistribution[0,1],{200,2}]]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

Chartwork:

RectangleChart[RandomReal[1,{50,50,2}],ChartLayout->"Stacked",Axes->None,BarSpacing->{0,1},PerformanceGoal->"Speed"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Histogram, paclet:ref/Histogram])  ▪  (RefLink[RectangleChart3D, paclet:ref/RectangleChart3D])  ▪  (RefLink[BarChart3D, paclet:ref/BarChart3D])  ▪  (RefLink[BubbleChart, paclet:ref/BubbleChart])  ▪  (RefLink[SectorChart, paclet:ref/SectorChart])  ▪  (RefLink[ListPlot, paclet:ref/ListPlot])  ▪  (RefLink[ListLinePlot, paclet:ref/ListLinePlot])  ▪  (RefLink[ListLogPlot, paclet:ref/ListLogPlot])  ▪  (RefLink[PairedBarChart, paclet:ref/PairedBarChart])  ▪  (RefLink[Rectangle, paclet:ref/Rectangle])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Charting and Information Visualization, paclet:guide/ChartingAndInformationVisualization])}})}})