using System;
using System.Windows.Controls;
using LiveCharts;
using LiveCharts.Wpf;
namespace Wpf.CartesianChart.Basic_Stacked_Bar{/// <summary>/// Interaction logic for StackedColumnExample.xaml/// </summary>public partial classBasicStackedColumnExample:UserControl{publicBasicStackedColumnExample(){InitializeComponent();SeriesCollection=newSeriesCollection{newStackedColumnSeries{Values=newChartValues<double>{4,5,6,8},StackMode=StackMode.Values,// this is not necessary, values is the default stack modeDataLabels=true},newStackedColumnSeries{Values=newChartValues<double>{2,5,6,7},StackMode=StackMode.Values,DataLabels=true}};//adding series updates and animates the chartSeriesCollection.Add(newStackedColumnSeries{Values=newChartValues<double>{6,2,7},StackMode=StackMode.Values});//adding values also updates and animatesSeriesCollection[2].Values.Add(4d);Labels=new[]{"Chrome","Mozilla","Opera","IE"};Formatter= value => value +" Mill";DataContext= this;}publicSeriesCollectionSeriesCollection{get;set;}public string[]Labels{get;set;}publicFunc<double, string>Formatter{get;set;}}}