private void GenerateCharts()
{
List<string> parameterNames = Project.Settings.Parameters;
Table parameters = this._actor.parameters;
this._charts = new Chart[parameterNames.Count];
for (int i = 0; i < parameterNames.Count; i++)
{
var page = new TabPage(parameterNames[i]);
var chart = new Chart();
// ChartArea styling
chart.ChartAreas.Add(new ChartArea(parameterNames[i]));
chart.ChartAreas[0].Area3DStyle.Enable3D = Editor.Settings.Charting.ThreeD;
chart.ChartAreas[0].Area3DStyle.Inclination =
(int)Editor.Settings.Charting.Inclination;
chart.ChartAreas[0].Area3DStyle.Rotation =
(int)Editor.Settings.Charting.Rotation;
chart.ChartAreas[0].Area3DStyle.PointDepth =
(int)Editor.Settings.Charting.Depth;
chart.ChartAreas[0].AxisX.Minimum = this._actor.initial_level;
chart.ChartAreas[0].AxisX.Maximum = this._actor.final_level;
chart.ChartAreas[0].AxisY.Minimum = 0;
chart.ChartAreas[0].AxisY.Maximum = Project.Settings.GetMaxValue(i);
chart.ChartAreas[0].AxisX.IsMarginVisible = false;
chart.ChartAreas[0].AxisY.IsMarginVisible = false;
// Series styling
chart.Series.Add(new Series());
chart.Series[0].Color = Editor.Settings.Charting.Colors[i];
chart.Series[0].IsVisibleInLegend = false;
chart.Series[0]["LineTension"] =
Editor.Settings.Charting.SplineTension.ToString(CultureInfo.InvariantCulture);
// Plot points
for (int lvl = this._actor.initial_level; lvl < this._actor.final_level + 1; lvl++)
chart.Series[0].Points.AddXY(lvl, parameters[i, lvl]);
// Label styling
chart.ChartAreas[0].AxisX.LabelStyle.Interval =
(this._actor.final_level - this._actor.initial_level) / 10.0d;
chart.ChartAreas[0].AxisY.LabelStyle.Interval = Project.Settings.GetMaxValue(i) / 10.0d;
chart.ChartAreas[0].AxisX.LabelStyle.IntervalOffset = -1;
chart.ChartAreas[0].AxisX.LabelStyle.IsEndLabelVisible = true;
// Bind events
chart.MouseMove += this.ChartMouseMove;
chart.MouseDown += this.ChartMouseDown;
chart.MouseUp += this.ChartMouseUp;
chart.MouseEnter += this.ChartMouseEnter;
chart.MouseLeave += this.ChartMouseLeave;
// Add page and chart to tab control
page.Controls.Add(chart);
chart.Dock = DockStyle.Fill;
this._charts[i] = chart;
this.tabControlParameters.TabPages.Add(page);
}
ChartSettingsForm.SetChartType(Editor.Settings.Charting.Type, ref this._charts);
ChartSettingsForm.SetChartLighting(Editor.Settings.Charting.Lighting, ref this._charts);
}