private GradientChart CreateGradientChart(string variableName, ModifiableDataset sharedFixedVariables) { var gradientChart = new GradientChart { Dock = DockStyle.Fill, Margin = Padding.Empty, ShowLegend = false, ShowCursor = true, ShowConfigButton = false, YAxisTicks = 5, }; gradientChart.VariableValueChanged += async(o, e) => { var recalculations = VisibleGradientCharts.Except(new[] { (GradientChart)o }).Select(async chart => { await chart.RecalculateAsync(updateOnFinish: false, resetYAxis: false); }).ToList(); await Task.WhenAll(recalculations); if (recalculations.All(t => t.IsCompleted)) { SetupYAxis(); } }; gradientChart.Configure(new[] { Content }, sharedFixedVariables, variableName, Points); gradientChart.SolutionAdded += gradientChart_SolutionAdded; gradientChart.SolutionRemoved += gradientChart_SolutionRemoved; return(gradientChart); }
public GradientChartConfigurationDialog(GradientChart chart) { this.chart = chart; InitializeComponent(); }
private GradientChart CreateGradientChart(string variableName, ModifiableDataset sharedFixedVariables) { var gradientChart = new GradientChart { Dock = DockStyle.Fill, Margin = Padding.Empty, ShowLegend = false, ShowCursor = true, ShowConfigButton = false, YAxisTicks = 5, }; gradientChart.VariableValueChanged += async (o, e) => { var recalculations = VisibleGradientCharts.Except(new[] { (GradientChart)o }).Select(async chart => { await chart.RecalculateAsync(updateOnFinish: false, resetYAxis: false); }).ToList(); await Task.WhenAll(recalculations); if (recalculations.All(t => t.IsCompleted)) SetupYAxis(); }; gradientChart.Configure(new[] { Content }, sharedFixedVariables, variableName, Points); gradientChart.SolutionAdded += gradientChart_SolutionAdded; gradientChart.SolutionRemoved += gradientChart_SolutionRemoved; return gradientChart; }