private async Task ResizeChart()
        {
            CommandHelper ch = new CommandHelper();

            await ch.RunBackgroundWorkerWithFlagHelperAsync(() => IsDrawing, async() =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    //Filtering data based on the selection
                    try
                    {
                        chartCanvas.Children.Clear();
                        textCanvas.Children.RemoveRange(1, textCanvas.Children.Count - 1);
                        cs.AddChartStyle();

                        if (DataCollection != null)
                        {
                            if (DataCollection.Count > 0)
                            {
                                cs.SetLinesControl(new BindableCollection <LineSeries>(DataCollection));

                                if (!IsBubbleChart)
                                {
                                    lg.AddLegend(chartCanvas, new BindableCollection <LineSeries>(DataCollection));
                                }
                                else
                                {
                                    lg.AddLegend(chartCanvas, Unit);
                                    lg.AddColorBar(textCanvas, ColorMap);
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    finally
                    {
                    }
                });
            });
        }
示例#2
0
        private async Task ResizeChart()
        {
            CommandHelper ch = new CommandHelper();

            await ch.RunBackgroundWorkerWithFlagHelperAsync(() => IsDrawing, async() =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    //Filtering data based on the selection
                    try
                    {
                        drawingBackground.Visibility = Visibility.Visible;

                        chartCanvas.Children.Clear();
                        textCanvas.Children.RemoveRange(1, textCanvas.Children.Count - 1);
                        cs.AddTernaryChartStyle();

                        if (DataCollection != null)
                        {
                            if (DataCollection.Count > 0)
                            {
                                cs.SetLinesControl(new BindableCollection <LineSeries>(DataCollection));

                                lg.AddLegend(chartCanvas, new BindableCollection <LineSeries>(DataCollection));
                            }
                        }
                    }
                    catch
                    {
                    }
                    finally
                    {
                        drawingBackground.Visibility = Visibility.Hidden;
                    }
                });
            });
        }