Category / Section
How to display the chart area alone in WPF Chart (SfChart)?
1 min read
WPF Chart (SfChart) area represents the entire chart and all its elements. It’s a virtual rectangular area that includes all the chart elements like axis, legends, series, etc. If you want to display the chart area alone, you need to set the Visibility property of primary and secondary axes to Collapsed.
XAML
<syncfusion:SfChart x:Name="columnChart"> <syncfusion:SfChart.PrimaryAxis> <syncfusion:CategoryAxis Header="Computer sales" Visibility="Collapsed"/> </syncfusion:SfChart.PrimaryAxis> <syncfusion:SfChart.SecondaryAxis> <syncfusion:NumericalAxis Header="Quantity Sold" Visibility="Collapsed"/> </syncfusion:SfChart.SecondaryAxis> <syncfusion:ColumnSeries Label="2014" ItemsSource="{Binding Computers}" XBindingPath="Computer" YBindingPath="Year2014"/> </syncfusion:SfChart>
C#
this.columnChart.PrimaryAxis.Visibility = Visibility.Collapsed; this.columnChart.SecondaryAxis.Visibility = Visibility.Collapsed;