添加项目文件。

This commit is contained in:
akwkevin
2021-07-23 09:42:22 +08:00
commit f25a958797
2798 changed files with 352360 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
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 class BasicStackedColumnExample : UserControl
{
public BasicStackedColumnExample()
{
InitializeComponent();
SeriesCollection = new SeriesCollection
{
new StackedColumnSeries
{
Values = new ChartValues<double> {4, 5, 6, 8},
StackMode = StackMode.Values, // this is not necessary, values is the default stack mode
DataLabels = true
},
new StackedColumnSeries
{
Values = new ChartValues<double> {2, 5, 6, 7},
StackMode = StackMode.Values,
DataLabels = true
}
};
//adding series updates and animates the chart
SeriesCollection.Add(new StackedColumnSeries
{
Values = new ChartValues<double> {6, 2, 7},
StackMode = StackMode.Values
});
//adding values also updates and animates
SeriesCollection[2].Values.Add(4d);
Labels = new[] {"Chrome", "Mozilla", "Opera", "IE"};
Formatter = value => value + " Mill";
DataContext = this;
}
public SeriesCollection SeriesCollection { get; set; }
public string[] Labels { get; set; }
public Func<double, string> Formatter { get; set; }
}
}