You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiveChartPractice
{
public class SampleData
{
public SeriesCollection SeriesCollection { get; set; }
public string[] Labels { get; set; }
public Func<double, string> YFormatter { get; set; }
public SampleData()
{
this.SeriesCollection = new SeriesCollection()
{
new LineSeries()
{
Title = "Series 1",
Values = new ChartValues<double> { 4, 6, 5, 2, 4 }
},
new LineSeries()
{
Title = "Series 2",
Values = new ChartValues<double> { 6, 7, 3, 4 ,6 },
PointGeometry = null
},
new LineSeries()
{
Title = "Series 3",
Values = new ChartValues<double> { 4, 2, 7, 2, 7 },
PointGeometry = DefaultGeometries.Square,
PointGeometrySize = 15
},
};
this.Labels = new[] { "Jan", "Feb", "Mar", "Apr", "May" };
this.YFormatter = value => value.ToString("C");
}
}
}