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
 

 


Posted Friday, August 20, 2004 by Support
http://www.dotnetcharting.com/kb/KnowledgebaseArticle10358.aspx