From 246fb772c5bf7dd6a85143fadebece3b4d9f1e04 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 02:18:41 -0700 Subject: Add constants class and separate classes into regions --- grapher/Models/Charts/ChartXY.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 81874a2..e5a948a 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -15,11 +15,11 @@ namespace grapher { public class ChartXY { - #region Consts + #region Constants public const int ChartSeparationHorizontal = 10; - #endregion Consts + #endregion Constants #region Constructors -- cgit v1.2.3 From 4aa2f3ed741dcbd39233e125a34cac8163267d8d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 02:39:09 -0700 Subject: Move constants to central class --- grapher/Models/Charts/ChartXY.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index e5a948a..6a65e41 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -15,12 +15,6 @@ namespace grapher { public class ChartXY { - #region Constants - - public const int ChartSeparationHorizontal = 10; - - #endregion Constants - #region Constructors public ChartXY(Chart chartX, Chart chartY) @@ -31,7 +25,7 @@ namespace grapher ChartY.Top = ChartX.Top; ChartY.Height = ChartX.Height; ChartY.Width = ChartX.Width; - ChartY.Left = ChartX.Left + ChartX.Width + ChartSeparationHorizontal; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; SetupChart(ChartX); SetupChart(ChartY); -- cgit v1.2.3 From 1462da675f1bc36d2a770413f13ccc68165cf1e9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 20:30:15 -0700 Subject: Add chart resize --- grapher/Models/Charts/ChartXY.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 6a65e41..7998f7f 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -29,6 +29,9 @@ namespace grapher SetupChart(ChartX); SetupChart(ChartY); + + Widened = false; + SetWidened(); } #endregion Constructors @@ -76,6 +79,8 @@ namespace grapher public bool Combined { get; private set; } + public bool Widened { get; private set; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -174,6 +179,34 @@ namespace grapher } } + public void SetWidened() + { + if (!Widened) + { + ChartX.Width = Constants.WideChartWidth; + ChartY.Width = Constants.WideChartWidth; + + ChartX.Left = Constants.WideChartLeft; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; + + Widened = true; + } + } + + public void SetNarrowed() + { + if (Widened) + { + ChartX.Width = Constants.NarrowChartWidth; + ChartY.Width = Constants.NarrowChartWidth; + + ChartX.Left = Constants.NarrowChartLeft; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; + + Widened = false; + } + } + public void Hide() { ChartX.Hide(); -- cgit v1.2.3 From 9502dcf7608475857b1487375997d20a9d29622e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 01:26:22 -0700 Subject: Remove and sort usings en masse --- grapher/Models/Charts/ChartXY.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 7998f7f..5ff2a8d 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -1,15 +1,6 @@ -using grapher.Models.Charts; -using grapher.Models.Mouse; -using System; +using grapher.Models.Mouse; using System.Collections; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; -using static grapher.AccelCharts; namespace grapher { -- cgit v1.2.3 From 25ab05b2854428891b1615b7b78e9257c2d6db35 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:44:53 -0700 Subject: Add option to turn off last mouse move dot --- grapher/Models/Charts/ChartXY.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 5ff2a8d..2037190 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -124,7 +124,7 @@ namespace grapher YPointData = y; } - public void DrawPoints() + public void DrawLastMovementValue() { if(Combined) { @@ -137,6 +137,12 @@ namespace grapher } } + public void ClearLastValue() + { + ChartX.Series[1].Points.Clear(); + ChartY.Series[1].Points.Clear(); + } + public void Bind(IDictionary data) { ChartX.Series[0].Points.DataBindXY(data.Keys, data.Values); -- cgit v1.2.3 From b8a8eb8a70cf71c61e5dc851229a83027f43194d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 15:20:31 -0700 Subject: By component, anisotropy full works --- grapher/Models/Charts/ChartXY.cs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'grapher/Models/Charts/ChartXY.cs') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 2037190..30be229 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -21,6 +21,9 @@ namespace grapher SetupChart(ChartX); SetupChart(ChartY); + Combined = false; + SetCombined(); + Widened = false; SetWidened(); } @@ -72,6 +75,8 @@ namespace grapher public bool Widened { get; private set; } + public bool Visible { get; private set; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -167,7 +172,7 @@ namespace grapher { if (Combined) { - if (ChartX.Visible) + if (Visible) { ChartY.Show(); } @@ -206,17 +211,26 @@ namespace grapher public void Hide() { - ChartX.Hide(); - ChartY.Hide(); + if (Visible) + { + ChartX.Hide(); + ChartY.Hide(); + Visible = false; + } } public void Show() { - ChartX.Show(); - - if (!Combined) + if (!Visible) { - ChartY.Show(); + ChartX.Show(); + + if (!Combined) + { + ChartY.Show(); + } + + Visible = true; } } -- cgit v1.2.3