Пример #1
0
        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();
        }
Пример #2
0
        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);
            }
        }