The WPF spline range area Chart is used to display continuous data points as a set of splines that vary between high and low values over intervals of time and across different categories.
Empty or null data points are elegantly handled in spline range area charts.
Use four types of rendering: natural, monotonic, cardinal, and clamped.
Rotate the spline range area chart to plot data vertically and view it from a different perspective.
Easily get started with the WPF Spline Range Area Chart using a few simple lines of C# code example as demonstrated below,
<Window x:Class="ChartExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ChartExample"
xmlns:chart="clr-namespace:Syncfusion.UI.Xaml.Charts;assembly=Syncfusion.SfChart.WPF"
mc:Ignorable="d"
Title="WPF Spline Range Area Chart" Height="450" Width="700">
<!--Setting DataContext-->
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
<StackPanel>
<chart:SfChart Height="300" Width="500">
<!--Initialize the horizontal axis for the WPF Chart-->
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis/>
</chart:SfChart.PrimaryAxis>
<!--Initialize the vertical axis for the WPF Chart-->
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis/>
</chart:SfChart.SecondaryAxis>
<!--Adding Spline Range Area Series to the WPF Chart-->
<chart:SplineRangeAreaSeries
High="Stock"
ItemsSource="{Binding Products}"
Low="Price"
XBindingPath="ProductName">
</chart:SplineRangeAreaSeries>
</chart:SfChart>
</StackPanel>
</Window>
public class SplineRangeAreaChartModel
{
public string ProductName { get; set; }
public double Price { get; set; }
public double Stock { get; set; }
}
public class ViewModel
{
public ObservableCollection<SplineRangeAreaChartModel> Products { get; set; }
public ViewModel()
{
this.Products = new ObservableCollection<SplineRangeAreaChartModel>();
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Rice", Price = 20, Stock = 53 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Wheat", Price = 22, Stock = 76 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Oil", Price = 30, Stock = 80 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Corn", Price = 26, Stock = 50 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Gram", Price = 36, Stock = 68 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Milk", Price = 20, Stock = 90 });
Products.Add(new SplineRangeAreaChartModel() { ProductName = "Butter", Price = 40, Stock = 73 });
}
}
The WPF Spline Range Area Chart configuration code is available in GitHub.
WPF Spline Range Area Chart User Guide
Learn more about the available options to customize WPF Spline Range Area Charts.
WPF Spline Range Area Chart API references
Explore the WPF Spline Range Area Chart APIs.