Controlling the width of columns and cylinders?

Expand / Collapse
 

Controlling the width of columns and cylinders?


QUESTION

How can I control the width of columns and cylinders?

ANSWER

The column or cylinder width can be controlled by 2 properties set on the category axis of your chart. For vertical charts the x axis is the category axis. For horizontal charts use the y axis.

Properties:

  • Axis.SpacingPercentage
    Gets or sets a percentage (0 - 100) which indicates the spacing between columns, cylinders or groups thereof.
     
  • Axis.StaticColumnWidth
    Gets or sets the static bar width in pixels.
     

Example
This code specifies the column or cylinder widths for a ChartType.Combo chart.

[C#]

Chart.XAxis.SpacingPercentage = 30; // Default is 16

// When this property is set, it takes precedence over spacing percentage.
Chart.XAxis.StaticColumnWidth = 20;
 

 
[Visual Basic]

' Default is 16
Chart.XAxis.SpacingPercentage = 30

' When this property is set, it takes precedence over spacing percentage.
Chart.XAxis.StaticColumnWidth = 20
 

 



Rate this Article:
     

Add Your Comments


Comment require login or registration.

Details
Last Modified:Tuesday, January 31, 2006
Last Modified By: Support
Type: HOWTO
Rated 2 stars based on 5 votes.
Article has been viewed 5,960 times.
Options