public MainWindow() { InitializeComponent(); this.Closing += MainWindow_Closing; this.random = new Random(); this.timer = new Timer(1000); this.timer.Elapsed += Timer_Elapsed; this.liveChart = new LiveChart("Livechart", "ChartXAxis", "ChartYAxis", 40, 400, 200, 20, LiveChart.BlueGreenTheme, cnv_Main, false, true, true, true, true, true, true); this.MouseMove += MainWindow_MouseMove; this.timer.Start(); }
private async void RefreshChart(object sender, RoutedEventArgs e) { try { var selectedDate = DateTimePicker.SelectedDate; if (!selectedDate.HasValue) { return; } var visualizer = new RandomDailyTicksVisualizer(ReportBlock); var result = await visualizer.Visualize(selectedDate.Value); LiveChart.Refresh(result); LiveChart?.HideError(); } catch (Exception exception) { LiveChart?.ShowError(exception.Message); } }