private void button1_Click(object sender, EventArgs e) { SaveFileDialog chartexportfilelocation = new SaveFileDialog(); chartexportfilelocation.Filter = "PNG File(*.png)|*.png|All files(*.*)|*.*"; if (chartexportfilelocation.ShowDialog(this) == DialogResult.OK) { SimulationVisualResults.SaveImage(chartexportfilelocation.FileName, System.Drawing.Imaging.ImageFormat.Png); } }
private void populateChartSeriesData() { if (SimulationVisualResults.Series.Count > 0) { SimulationVisualResults.Series.Clear(); } SimulationVisualResults.Series.Add("Population Change over Time").Points.DataBindXY(this.results.TimeSeries, this.results.PopulationGrowthOverTime); SimulationVisualResults.Series.Add("Death Rate Change over Time").Points.DataBindXY(this.results.TimeSeries, this.results.DeathRateOverTime); SimulationVisualResults.Series["Population Change over Time"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; SimulationVisualResults.Series["Death Rate Change over Time"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; SimulationVisualResults.Show(); }
private void populateChartSeriesData() { try { if (SimulationVisualResults.Series.Count > 0) { SimulationVisualResults.Series.Clear(); } SimulationVisualResults.Series.Add("Prey Population Change over Time").Points.DataBindXY(this.preyResults.TimeSeries, this.preyResults.PopulationGrowthOverTime); SimulationVisualResults.Series.Add("Predator Population Change over Time").Points.DataBindXY(this.predatorResults.TimeSeries, this.predatorResults.PopulationGrowthOverTime); SimulationVisualResults.Series["Prey Population Change over Time"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; SimulationVisualResults.Series["Predator Population Change over Time"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; SimulationVisualResults.Show(); } catch (Exception ex) { MessageBox.Show("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void populateChartSeriesData() { SimulationVisualResults.Series.Add("Populate Change over Time").Points.DataBindXY(this.results.TimeSeries, this.results.PopulationGrowthOverTime); SimulationVisualResults.Show(); }