BarWidth Property

Microsoft Office Web Components Visual Basic

BarWidth Property

Use to set or specify a specific width for the data markers in bar and column charts. Returns Long. Read/write Long.

expression.BarWidth

expression    Required. An expression that returns a ChChart object.

Remarks

The BarWidth property is specified in hundredths of a point (1/7200 of an inch.) The default value of zero (0) means "automatic".

Setting this property changes the scroll view extent of the ChScrollView object of a chart control. This property is only valid for bar and column charts. It has no effect on other chart types. This property has an effect only if the HorizontalExtentMax property for the column charts and the VerticalExtentMax property for the bar chart are non-zero.

After you set the BarWidth property, users won't be able to change the HorizontalExtent or VerticalExtent properties. Changing the HorizontalExtent or VerticalExtent properties will have no effect because the BarWidth property value will override any HorizontalExtent or VerticalExtent values and maintain the bar width until the BarWidth property is disabled. You disable the BarWidth property by setting it to zero (0).

Example

The example below shows you how to set the bar width of the chart to one inch by setting its value to 7200. If you want to set the bar width to half an inch, the value to specify would be 3600.

    Chartspace1.Charts(0).Barwidth = 7200