summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-07-09 17:40:24 -0700
committerJacob Palecki <[email protected]>2021-07-09 17:40:24 -0700
commit6b42144e72dd10d79dcff994b864318683e0041a (patch)
tree1f3c49106d19ebd387850831d8b390fdaa612455
parentSmall bugfix + add default text for LUT (diff)
downloadrawaccel-6b42144e72dd10d79dcff994b864318683e0041a.tar.xz
rawaccel-6b42144e72dd10d79dcff994b864318683e0041a.zip
Fix gain graph legend position
-rw-r--r--grapher/Models/Charts/AccelCharts.cs1
-rw-r--r--grapher/Models/Charts/ChartXY.cs15
2 files changed, 15 insertions, 1 deletions
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index 7682120..631c2e2 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -162,6 +162,7 @@ namespace grapher
velocityChart.SetTop(sensitivityChart.Height + Constants.ChartSeparationVertical);
gainChart.SetHeight(sensitivityChart.Height);
gainChart.SetTop(velocityChart.Top + velocityChart.Height + Constants.ChartSeparationVertical);
+ gainChart.SetLegendPosition(ChartXY.GainLegendPosition);
}
private void OnEnableClick(object sender, EventArgs e)
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index 5bafb94..6a34d9b 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -7,6 +7,13 @@ namespace grapher
{
public class ChartXY
{
+ #region Fields
+
+ public static ElementPosition DefaultLegendPosition = new ElementPosition(25, 0, 50, 25);
+ public static ElementPosition GainLegendPosition = new ElementPosition(25, -1, 50, 25);
+
+ #endregion Fields
+
#region Constructors
public ChartXY(Chart chartX, Chart chartY, string title)
@@ -167,7 +174,7 @@ namespace grapher
legend.DockedToChartArea = area.Name;
legend.LegendStyle = LegendStyle.Row;
- ElementPosition legendPosNew = new ElementPosition(25, 0, 50, 25);
+ ElementPosition legendPosNew = DefaultLegendPosition;
legend.Position = legendPosNew;
System.Drawing.Color bgTrans = System.Drawing.Color.Transparent;
@@ -279,6 +286,12 @@ namespace grapher
ChartX.Series[2].IsVisibleInLegend = true;
}
+ public void SetLegendPosition(ElementPosition position)
+ {
+ ChartX.Legends[0].Position = position;
+ ChartY.Legends[0].Position = position;
+ }
+
private void VerifyRange(double min, double max)
{
if (min > max)