apex:barSeries

A data series to be rendered as bars in a Visualforce chart. At a minimum you must specify the fields in the data collection to use as X and Y values for each bar, as well as the X and Y axes to scale against. Add multiple Y values to add grouped or stacked bar segments to the chart. Each segment takes a new color.

Note: This component must be enclosed within an <apex:chart> component. You can have multiple <apex:barSeries> and <apex:lineSeries> components in a single chart. You can also add <apex:areaSeries> and <apex:scatterSeries> components, but the results might not be very readable.

Example 

1<!-- Page: -->
2<apex:chart height="400" width="700" data="{!data}">
3    <apex:axis type="Numeric" position="left" fields="data1"
4        title="Opportunities Closed" grid="true"/>
5    <apex:axis type="Numeric" position="right" fields="data3"
6        title="Revenue (millions)"/>
7    <apex:axis type="Category" position="bottom" fields="name"
8        title="Month of the Year"/>
9    <apex:barSeries title="Monthly Sales" orientation="vertical" axis="right"
10        xField="name" yField="data3">
11        <apex:chartTips height="20" width="120"/>
12    </apex:barSeries>
13    <apex:lineSeries title="Closed-Won" axis="left" xField="name" yField="data1"/>
14</apex:chart>

Attributes 

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
axisStringWhich axis this chart series should bind to. Must be one of the four edges of the chart: left, right, top, or bottom The axis bound to must be defined by a sibling <apex:axis> component.Yes23.0
colorSetStringA set of color values used, in order, as bar fill colors. Colors are specified as HTML-style (hexadecimal) colors, and should be comma separated. For example, #00F,#0F0,#F00. 26.0
colorsProgressWithinSeriesBooleanA Boolean value that specifies how to progress through the values of the colorSet attribute. When set to true, the first color in the colorSet is used for the first bar (or bar segment, when the <apex:barSeries> is stacked) in an <apex:barSeries>, the second color for the second bar, and so on. Colors restart at the beginning for each <apex:barSeries>. When set to false, the default, the first color in the colorSet is used for all bars in the first <apex:barSeries>, the second color is used for bars in the second <apex:barSeries>, and so on. 26.0
groupGutterIntegerAn integer specifying the spacing between groups of bars, as a percentage of the bar width. 26.0
gutterIntegerAn integer specifying the spacing between individual bars, as a percentage of the bar width. 26.0
highlightBooleanA Boolean value that specifies whether each bar should be highlighted when the mouse pointer passes over it. If not specified, this value defaults to true. 23.0
highlightColorStringA string that specifies the HTML-style color overlayed on a bar when it’s highlighted. 26.0
highlightLineWidthIntegerAn integer that specifies the width in pixels of the line that surrounds a bar when it’s highlighted. 26.0
highlightOpacityStringA decimal number between 0 (transparent) and 1 (opaque) representing the opacity of the color overlayed on a bar when it’s highlighted. 26.0
highlightStrokeStringA string that specifies the HTML-style color of the line that surrounds a bar when it’s highlighted. 26.0
idStringAn identifier that allows the chart component to be referenced by other components on the page. 23.0global
orientationStringThe direction of the bars in the chart. Valid options are: horizontal or verticalYes23.0
renderedBooleanA Boolean value that specifies whether the chart series is rendered in the chart. If not specified, this value defaults to true. 23.0
rendererFnStringA string that specifies the name of a JavaScript function that augments or overrides how each bar is rendered. Implement to provide additional styling or to augment data. 26.0
showInLegendBooleanA Boolean value that specifies whether this chart series should be added to the chart legend. If not specified, this value defaults to true. 23.0
stackedBooleanA Boolean value that specifies whether to group or stack bar values. 26.0
tipsBooleanA Boolean value that specifies whether to display a tool tip for each bar when the mouse pointer passes over it. The format of the tip is xField: yField. If not specified, this value defaults to true. 23.0
titleStringThe title of this chart series, which is displayed in the chart legend. For stacked charts with multiple data series in the yField, separate each series title with a comma. title="MacDonald,Picard,Worle". 23.0
xFieldStringThe field in each record provided in the chart data from which to retrieve the x-axis value for each data point in the series. This field must exist in every record in the chart data.Yes23.0
xPaddingIntegerAn integer specifying the padding in pixels between the left and right axes and the chart’s bars. 26.0
yFieldStringThe field in each record provided in the chart data from which to retrieve the y-axis value for each data point in the series. This field must exist in every record in the chart data.Yes23.0
yPaddingIntegerAn integer specifying the padding in pixels between the top and bottom axes and the chart’s bars. 26.0

See Also