Segment Spacing in WinUI Chart (SfPyramidChart)

1 Jul 20211 minute to read

The gap between each segment in the pyramid chart can be set using the GapRatio property. The default value of GapRatio property is 0 and its value ranges from 0 to 1.

<chart:SfPyramidChart x:Name="chart"
        Palette="BlueChrome"
        ItemsSource="{Binding Data}" 
        XBindingPath="Category" 
        YBindingPath="Value" 
        GapRatio="0.3">
</chart:SfPyramidChart>
SfPyramidChart chart = new SfPyramidChart();
chart.Palette = ChartColorPalette.BlueChrome;
chart.SetBinding(SfPyramidChart.ItemsSourceProperty, new Binding() { Path = new PropertyPath("Data") });
chart.XBindingPath = "Category";
chart.YBindingPath = "Value";
chart.GapRatio = 0.3;
. . . 
this.Content = chart;

Segment spacing in WinUI Chart