ArcObjects Library Reference  (Display)    

IBarChartSymbol Interface

Provides access to members that control bar chart symbol properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

This interface provides access to the properties of a BarChartSymbol which is used by a ChartRenderer to draw bar or column charts for a feature layer.

Members

Description
Read/write property Axes The axis symbol.
Read/write property ShowAxes Indicates if the axis are shown.
Read/write property Spacing The spacing between bars in points.
Read/write property VerticalBars Indicates if the bars are oriented vertically.
Read/write property Width The width of each bar in points.

CoClasses that implement IBarChartSymbol

CoClasses and Classes Description
BarChartSymbol Defines a bar chart symbol.

Remarks

Use this interface to access the properties of a BarChartSymbol which is a data driven symbol used by a ChartRenderer to draw features with bar/column charts.

When setting up a ChartRenderer to draw bar/colunn charts through code, you need to work with this interface.

[Visual Basic 6.0]

The VBA code below illustrates setting up a typical chart renderer
object.

'Set up the chart marker symbol to use with the renderer
Dim pBarChartSymbol As IBarChartSymbol, pFillSymbol As IFillSymbol
Dim pMarkerSymbol As IMarkerSymbol, pSymbolArray As ISymbolArray
Dim pChartSymbol As IChartSymbol, pChartRenderer As IChartRenderer
Dim pRendererFields As IRendererFields
' Create a new bar chart symbol
Set pBarChartSymbol = New BarChartSymbol
' Set the width of each bar - units are points
pBarChartSymbol.Width = 6
Set pMarkerSymbol = pBarChartSymbol ' QI to marker symbol interface
Set pChartSymbol = pBarChartSymbol ' QI to chart symbol interface
pChartSymbol.maxValue = maxValue ' This is the biggest value of all bars
pMarkerSymbol.Size = 30 ' This is the maximum height of the biggest bar
Set pSymbolArray = pBarChartSymbol
Set pFillSymbol = New SimpleFillSymbol
pFillSymbol.Color = GetRGBColor(213, 212, 252) ' pastel green
pSymbolArray.AddSymbol pFillSymbol
Set pFillSymbol = New SimpleFillSymbol
pFillSymbol.Color = GetRGBColor(193, 252, 179) ' pastel purple
pSymbolArray.AddSymbol pFillSymbol
Set pChartRenderer = New ChartRenderer ' Create a new chart renderer
' Set up the fields that comprise the components of a chart; a bar in
' a bar chart or a slice of a pie chart
Set pRendererFields = pChartRenderer
pRendererFields.AddField "MALES"
pRendererFields.AddField "FEMALES"
' Set the chart symbol into the renderer. This could also be a stacked
' bar or pie chart
Set pChartRenderer.ChartSymbol = pBarChartSymbol
Set pFillSymbol = New SimpleFillSymbol
pFillSymbol.Color = GetRGBColor(239, 228, 190)
Set pChartRenderer.BackgroundSymbol = pFillSymbol
' Disable so that charts appear in polygon centers
pChartRenderer.UseOverposter = False
pChartRenderer.CreateLegend ' Create the legend symbols
pChartRenderer.Label = "Population by Gender"

 

See Also

IChartSymbol Interface | IBarChartSymbol Interface

 


Feedback Send feedback on this page