Rendering Mode in WinUI Chart (SfPyramidChart)
18 Nov 20182 minutes to read
The Mode property is used to define the rendering mode of the pyramid chart such as Surface or Linear. The default value of the Mode property is Linear.
Surface Mode
The Surface mode is used to render the area of pyramid chart segments based on data point values.
<chart:SfPyramidChart
x:Name="chart"
ItemsSource="{Binding Data}"
XBindingPath="Category"
YBindingPath="Value"
Mode="Surface">
</chart:SfPyramidChart>SfPyramidChart chart = new SfPyramidChart();
chart.SetBinding(SfPyramidChart.ItemsSourceProperty, new Binding()
{
Path = new PropertyPath("Data")
});
chart.XBindingPath = "Category";
chart.YBindingPath = "Value";
chart.Mode = ChartPyramidMode.Surface;
// Configure additional chart elements
this.Content = chart;
Linear Mode
The Linear mode is used to render the height of pyramid chart segments based on data point values.
<chart:SfPyramidChart
x:Name="chart"
ItemsSource="{Binding Data}"
XBindingPath="Category"
YBindingPath="Value"
Mode="Linear">
</chart:SfPyramidChart>SfPyramidChart chart = new SfPyramidChart();
chart.SetBinding(SfPyramidChart.ItemsSourceProperty, new Binding()
{
Path = new PropertyPath("Data")
});
chart.XBindingPath = "Category";
chart.YBindingPath = "Value";
chart.Mode = ChartPyramidMode.Linear;
// Configure additional chart elements
this.Content = chart;