summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-22 02:28:35 -0700
committerJacob Palecki <[email protected]>2020-09-22 02:28:35 -0700
commit8e58892723ee10792c7d3db275da826f98d01677 (patch)
tree25d5c35fba0734f891737aa038e882f318296353 /grapher/Models/Charts
parentMerge remote-tracking branch 'upstream/Experiment' into GUI (diff)
downloadrawaccel-8e58892723ee10792c7d3db275da826f98d01677.tar.xz
rawaccel-8e58892723ee10792c7d3db275da826f98d01677.zip
Mostly works
Diffstat (limited to 'grapher/Models/Charts')
-rw-r--r--grapher/Models/Charts/AccelCharts.cs5
-rw-r--r--grapher/Models/Charts/ChartState/ChartState.cs24
-rw-r--r--grapher/Models/Charts/ChartXY.cs16
3 files changed, 45 insertions, 0 deletions
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index d22ab78..a0e99c8 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -149,6 +149,11 @@ namespace grapher
ChartState.Calculate(accel, settings);
}
+ public void SetLogarithmic(bool x, bool y)
+ {
+ ChartState.SetLogarithmic(x, y);
+ }
+
private static void SetupCharts(
ChartXY sensitivityChart,
ChartXY velocityChart,
diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs
index ea67e83..e1c7d01 100644
--- a/grapher/Models/Charts/ChartState/ChartState.cs
+++ b/grapher/Models/Charts/ChartState/ChartState.cs
@@ -100,5 +100,29 @@ namespace grapher.Models.Charts.ChartState
GainChart.Hide();
form.Height = SensitivityChart.Height + borderHeight;
}
+
+ public void SetLogarithmic(bool x, bool y)
+ {
+ if (x)
+ {
+ ChartXY.SetLogarithmic(SensitivityChart.ChartX);
+ ChartXY.SetLogarithmic(GainChart.ChartX);
+ }
+ else
+ {
+ ChartXY.SetStandard(SensitivityChart.ChartX);
+ ChartXY.SetStandard(GainChart.ChartX);
+ }
+
+ if (y)
+ {
+ ChartXY.SetLogarithmic(SensitivityChart.ChartY);
+ ChartXY.SetLogarithmic(GainChart.ChartY);
+ }
+ {
+ ChartXY.SetStandard(SensitivityChart.ChartY);
+ ChartXY.SetStandard(GainChart.ChartY);
+ }
+ }
}
}
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index fdd0258..b17960b 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -132,6 +132,22 @@ namespace grapher
}
}
+ public static void SetLogarithmic(Chart chart)
+ {
+ chart.ChartAreas[0].AxisX.Minimum = 0.001;
+ chart.ChartAreas[0].AxisX.Maximum = 3500;
+ chart.ChartAreas[0].AxisY.Minimum = 0.001;
+ chart.ChartAreas[0].AxisY.Maximum = 10;
+ chart.ChartAreas[0].AxisX.IsLogarithmic = true;
+ chart.ChartAreas[0].AxisY.IsLogarithmic = true;
+ }
+
+ public static void SetStandard(Chart chart)
+ {
+ chart.ChartAreas[0].AxisX.IsLogarithmic = false;
+ chart.ChartAreas[0].AxisY.IsLogarithmic = false;
+ }
+
public void SetPointBinds(PointData combined, PointData x, PointData y)
{
CombinedPointData = combined;