Articles in this section
Category / Section

How to increase or decrease the width of Column series?

1 min read

Essential chart for Xamarin.Forms has support to increase or decrease the width of the column series segments. Column series contains the Spacing property that allows you to change the width of the column series segments.

The default value of the Spacing property is 0.2; the segment’s width is inversely proportional to the value of Spacing property. When the value of the Spacing property is increased, the gap between the adjacent columns is also increased, and the column’s width is decreased, and vice-versa. The following code example illustrates how to use the Spacing property.

XAML

<chart:SfChart.Series>
    <chart:ColumnSeries Spacing="0.6" ItemsSource = "{Binding Data}"/>
</chart:SfChart.Series>

C#

chart.Series = new ChartSeriesCollection
{
  new ColumnSeries()
  {
     ItemsSource = GetCategoryData(),
     Spacing = 0.6  
  }
};

The following screenshot displays the column series with spacing value 0.6.

 

Output

Chart column series with spacing applied between the column segments in Xamarin.Forms

Figure 1: Column series with spacing value 0.6.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied