ArcObjects Library Reference (Carto)  

IScaleBar Interface

Provides access to members that control the scalebar map surrounds.

Product Availability

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

Members

Description
Read/write property BarColor Color used to draw the bar.
Read/write property BarHeight Height of the bar in points (1/72 inch).
Method DelayEvents Used to batch operations together to minimize notifications.
Read/write property Division Number of units in one major division.
Read/write property Divisions Total number of divisions (including those before zero).
Read/write property DivisionsBeforeZero Number of divisions to the left of zero.
Method Draw Draws the map surround into the specified display bounds.
Method FitToBounds Adjusts the map surround to fit the bounds. The changed argument indicates whether the size of the map surround was changed.
Read-only property Icon Icon used to represent the map surround.
Read/write property LabelFrequency The label style indicating which marks are labeled.
Read/write property LabelGap Vertical gap between the bar and the labels in points (1/72 inch).
Read/write property LabelPosition Vertical positioning of the mark labels.
Read/write property LabelSymbol Symbol used to draw the labels.
Read/write property Map The parent map.
Read/write property Name Name of the map surround.
Read/write property NumberFormat Number format.
Method QueryBounds Returns the bounds of the map surround.
Method Refresh Makes sure the latest updates are refected the next time the Map Surround is drawn.
Read/write property ResizeHint Indicates what happens when scale bar is resized.
Read/write property Subdivisions Number of subdivisions per major division.
Read/write property UnitLabel The unit label.
Read/write property UnitLabelGap Gap between the scale bar and the unit label in points (1/72 inch).
Read/write property UnitLabelPosition Vertical positioning of the unit label.
Read/write property UnitLabelSymbol Unit label symbol.
Read/write property Units The units reported.
Method UseMapSettings Sets division and units based on map.

Inherited Interfaces

Interfaces Description
IMapSurround Provides access to members that control the map surround.

CoClasses that implement IScaleBar

CoClasses and Classes Description
AlternatingScaleBar A map surround for displaying a single alternating scale bar.
DoubleAlternatingScaleBar A map surround for displaying a double alternating scale bar.
HollowScaleBar A map surround for displaying a hollow scale bar.
ScaleLine A map surround for displaying a scale line.
SingleDivisionScaleBar A map surround for displaying a single division scale bar.
SteppedScaleLine A map surround for displaying a stepped scale line.

Remarks

The IScaleBar interface manages most of the properties of a scale bar.

Other interfaces relevant to the scale bar's format are IScaleMarks, IScaleLine, ISingleFillScaleBar and IDoubleFillScaleBar. See the Carto Library Overview to find out how these interfaces work together to create various types of scale bars.

BarHeight defines the height of the scale bar and is always expressed in points and BarColor is an IColor defining its color.

ResizeHint is an esriScaleBarResizeHint constant defining what happens when the scale bar is resized. The choices are a fixed scale bar, increasing the space between the division marks or the number of divisions.

Divisions and Subdvisions

The Divisions property controls the total number of divisions on the scale bar including divisions before zero which of course, are defined by the DivisionsBeforeZero property. Unsurprisingly, Subdivisions controls the number of subdivisions. Use IScaleMarks::MarkFrequency to set which divisions and subdivisions will be shown.

Division is expressed in the units the scale bar will show and defines the spacing of the divisions.

Units and Unit Labels

Units is of type esriUnits and defines the units the scale bar will show.

UnitLabel is a string that will be displayed to show this unit. For instance "Km".

The UnitLabelPosition is an esriVertPosEnum constant that defines the position of the label relatively to the line. UnitLabelGap defines the space in points between the label and the scale bar and UnitLabelSymbol is a text symbol used to display the label.

UseMapSettings will restore Units and UnitLabel in accordance with map units.

Division Labels

The LabelFrequency is an esriScaleBarFrequency constant that defines on which divisions and subdivisions labels will be shown.

NumberFormat is an INumberFormat that allows you for instance to modify the number of decimals used to display the labels.

The LabelPosition is an esriVertPosEnum constant that defines the position of the labels relatively to the line. LabelGap defines the space in points between the labels and the scale bar and LabelSymbol is a text symbol used to display the labels.

.NET Snippets

Add Scale Bar