Cluster bars are created by using several instances of the BarSeries class. The first bar series created must have its MultiBarMode property set to MultiBarMode.Series. The MultiBarMode property of the subsequent bar series must be set to MultiBarMode.Clustered. Stacked bar series are displayed adjacent to each other. The following figure shows a typical clustered bar chart:
figure 1.
Creating the Cluster Bar Series
The following example demonstrates how to create a cluster bar chart with two clusters:
VB.NET | |
---|---|
|
C# | |
---|---|
|
Controlling the Gap Between the Clusters
The gap between the clusters is represented as a percentage of the space in the grid cell that is reserved for the current cluster. The user specifies this value with the help of the GapPercent property, which is by default set to 15. If the GapPercent properties of all bar series are set to 0, the bar clusters will be displayed no space between each other. On the other hand, if the GapPercent properties are set to 100, the bars will be displayed with 0 width. The following example increases the default gap space:
VB.NET | |
---|---|
|
C# | |
---|---|
|
Related Examples
Windows Forms: Series\Bar\Cluster Bar