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.
48 lines
1.5 KiB
48 lines
1.5 KiB
using LiveCharts.Wpf;
|
|
using LiveCharts;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace LiveChartPractice
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btnSeriesAdd_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
SampleData data = this.DataContext as SampleData;
|
|
if (data == null)
|
|
return;
|
|
|
|
Random rand = new Random();
|
|
data.SeriesCollection.Add(new LineSeries
|
|
{
|
|
Title = $"Series {data.SeriesCollection.Count + 1}",
|
|
Values = new ChartValues<double> { rand.Next(1, 8), rand.Next(1, 8), rand.Next(1, 8), rand.Next(1, 8), rand.Next(1, 8) },
|
|
LineSmoothness = rand.Next(0, 2), //0: straight lines, 1: really smooth lines
|
|
//PointGeometry = Geometry.Parse("m 25 70.36218 20 -28 -20 22 -8 -6 z"),
|
|
//PointGeometrySize = 50,
|
|
//PointForeground = Brushes.Gray
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|