diff options
| author | Jacob Palecki <[email protected]> | 2020-09-08 16:53:16 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-08 16:53:16 -0700 |
| commit | c6cc72badf507f13ef48e330efddb57fe3030a5d (patch) | |
| tree | e8960e5b9b9242bc18e4717acb5cdbb3ce524e1d /grapher/Models | |
| parent | Merge pull request #20 from JacobPalecki/GUI (diff) | |
| download | rawaccel-c6cc72badf507f13ef48e330efddb57fe3030a5d.tar.xz rawaccel-c6cc72badf507f13ef48e330efddb57fe3030a5d.zip | |
Clean up chart titles, axes, legends
Diffstat (limited to 'grapher/Models')
| -rw-r--r-- | grapher/Models/AccelGUIFactory.cs | 6 | ||||
| -rw-r--r-- | grapher/Models/Charts/ChartXY.cs | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 42a7b83..189c82a 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -91,9 +91,9 @@ namespace grapher.Models { var accelCharts = new AccelCharts( form, - new ChartXY(accelerationChart, accelerationChartY), - new ChartXY(velocityChart, velocityChartY), - new ChartXY(gainChart, gainChartY), + new ChartXY(accelerationChart, accelerationChartY, Constants.SensitivityChartTitle), + new ChartXY(velocityChart, velocityChartY, Constants.VelocityChartTitle), + new ChartXY(gainChart, gainChartY, Constants.GainChartTitle), showVelocityGainToolStripMenuItem, showLastMouseMoveMenuItem, writeButton); diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 30be229..1360409 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -8,10 +8,11 @@ namespace grapher { #region Constructors - public ChartXY(Chart chartX, Chart chartY) + public ChartXY(Chart chartX, Chart chartY, string title) { ChartX = chartX; ChartY = chartY; + Title = title; ChartY.Top = ChartX.Top; ChartY.Height = ChartX.Height; @@ -77,6 +78,8 @@ namespace grapher public bool Visible { get; private set; } + public string Title { get; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -110,6 +113,8 @@ namespace grapher chart.Series[1].Points.Clear(); chart.Series[1].Points.AddXY(0, 0); + + chart.Titles[0].Font = new System.Drawing.Font(chart.Titles[0].Font.Name, 9.0f, System.Drawing.FontStyle.Italic); } public static void DrawPoint(Chart chart, PointData point) @@ -165,6 +170,7 @@ namespace grapher { ChartY.Hide(); Combined = true; + ChartX.Titles[0].Text = Title; } } @@ -177,6 +183,9 @@ namespace grapher ChartY.Show(); } + ChartX.Titles[0].Text = SetComponentTitle(Constants.XComponent); + ChartY.Titles[0].Text = SetComponentTitle(Constants.YComponent); + Combined = false; } } @@ -246,6 +255,10 @@ namespace grapher ChartY.Height = height; } + private string SetComponentTitle(string component) + { + return $"{Title} : {component}"; + } #endregion Methods } } |