Syncfusion Feedback


Overview

The WPF 100% Stacked Column Chart visualizes data with y-values stacked over one another in the series order. It shows the relationship between individual values to the total sum of the points.

WPF 100 Percentage Stacked Column Chart documentation

WPF 100 Percentage Stacked Column Chart


Key features

WPF Grouped Stacked Column chart

Grouped stacked chart

Group a series with another series using the group name in a chart. Group the series with different stacking names separately.

WPF stacked Column Chart Showing Spacing between Bars

Spacing and width

Customize the spacing between two rectangles.

WPF Stacked Column Chart with Markers

Display markers

The WPF 100% Stacked Column Chart data points are visualized as marks with the built-in symbols such as cross, square, plus, inverted triangles, hexagon, ellipses, vertical lines, horizontal lines, diamonds, triangles, and pentagons.

WPF Stacked Column Chart with Data Labels

Data labels

Data labels display information about the data points. It provides the support for customizing the foreground, border, and background in addition to template support to customize the default appearance with the desired view. You can rotate a data label by its given angle.


Code example

Easily get started with WPF 100% Stacked Column Chart using a few simple lines of XAML and C# code, as demonstrated below,

  1. <Window x:Class="ChartExample.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:ChartExample"
  7. xmlns:chart="clr-namespace:Syncfusion.UI.Xaml.Charts;assembly=Syncfusion.SfChart.WPF"
  8. mc:Ignorable="d"
  9. Title="WPF 100% Stacked Column Chart" Height="450" Width="700">
  10. <!--Setting DataContext-->
  11. <Window.DataContext>
  12. <local:ViewModel/>
  13. </Window.DataContext>
  14. <StackPanel>
  15. <chart:SfChart Height="300" Width="500">
  16. <!--Initialize the horizontal axis for the WPF Chart-->
  17. <chart:SfChart.PrimaryAxis>
  18. <chart:DateTimeAxis LabelFormat="ddd" />
  19. </chart:SfChart.PrimaryAxis>
  20. <!--Initialize the vertical axis for the WPF Chart-->
  21. <chart:SfChart.SecondaryAxis>
  22. <chart:NumericalAxis />
  23. </chart:SfChart.SecondaryAxis>
  24.  
  25. <!--Adding 100% Stacked Column Series to the WPF Chart-->
  26.  
  27. <chart:StackingColumn100Series
  28. ItemsSource="{Binding Accidents}"
  29. XBindingPath="Month"
  30. YBindingPath="Bus">
  31. </chart:StackingColumn100Series>
  32.  
  33. <chart:StackingColumn100Series
  34. ItemsSource="{Binding Accidents}"
  35. XBindingPath="Month"
  36. YBindingPath="Car">
  37. </chart:StackingColumn100Series>
  38.  
  39. <chart:StackingColumn100Series
  40. ItemsSource="{Binding Accidents}"
  41. XBindingPath="Month"
  42. YBindingPath="Truck">
  43. </chart:StackingColumn100Series>
  44. </chart:SfChart>
  45. </StackPanel>
  46. </Window>
  1. public class StackingColumnChartModel
  2. {
  3. public DateTime Month { get; set; }
  4. public double Bus { get; set; }
  5. public double Car { get; set; }
  6. public double Truck { get; set; }
  7. }
  8.  
  9. public class ViewModel
  10. {
  11. public ObservableCollection<StackingColumnChartModel> Accidents
  12. {
  13. get;
  14. set;
  15. }
  16.  
  17. public ViewModel()
  18. {
  19. this.Accidents = new ObservableCollection<StackingColumnChartModel>();
  20. DateTime mth = new DateTime(2011, 1, 1);
  21.  
  22. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(6), Bus = 3, Car = 4, Truck = 5 });
  23. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(7), Bus = 4, Car = 5, Truck = 6 });
  24. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(8), Bus = 3, Car = 4, Truck = 5 });
  25. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(9), Bus = 4, Car = 5, Truck = 6 });
  26. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(10), Bus = 7, Car = 8, Truck = 7 });
  27. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(11), Bus = 4, Car = 5, Truck = 6 });
  28. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(12), Bus = 7, Car = 8, Truck = 7 });
  29. Accidents.Add(new StackingColumnChartModel() { Month = mth.AddMonths(13), Bus = 4, Car = 5, Truck = 6 });
  30. }
  31. }

Learning resources

Navigate to GitHub code used to configure the WPF Stacked Column Graph

GitHub code

Explore the 100% WPF Stacked Column Chart example from GitHub to learn how to render and configure charts.

Navigate to the options available in the user guide to customize the WPF Stacked Column Graph

WPF 100% Stacked Column Chart User Guide

Learn more about the available options to customize WPF 100% Stacked Column Graphs.

Navigate to the API references documentation of the WPF Stacked Column Graph

WPF 100% Stacked Column Chart API references

Explore the WPF 100% stacked column graph APIs.

95+ WPF CONTROLS

Scroll up icon
Chat with us