summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/ActiveValueLabelXY.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-08-20 14:22:14 -0700
committerJacob Palecki <[email protected]>2020-08-20 14:22:14 -0700
commit7dbeae9d4cf108e78072b356d832123f12e42a90 (patch)
tree9711fddfb5241a3dc859cd421aa4937d38a8852f /grapher/Models/Options/ActiveValueLabelXY.cs
parentDisplay active values (diff)
downloadrawaccel-7dbeae9d4cf108e78072b356d832123f12e42a90.tar.xz
rawaccel-7dbeae9d4cf108e78072b356d832123f12e42a90.zip
Add accel type to active values and tweak color
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs')
-rw-r--r--grapher/Models/Options/ActiveValueLabelXY.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs
index b3b580f..12506e9 100644
--- a/grapher/Models/Options/ActiveValueLabelXY.cs
+++ b/grapher/Models/Options/ActiveValueLabelXY.cs
@@ -8,7 +8,8 @@ namespace grapher.Models.Options
{
public class ActiveValueLabelXY
{
- public const int ActiveLabelXYSeparation = 4;
+ public const int ActiveLabelXYSeparation = 2;
+ public const string ShortenedFormatString = "0.###";
public ActiveValueLabelXY(
ActiveValueLabel x,
@@ -16,6 +17,14 @@ namespace grapher.Models.Options
{
X = x;
Y = y;
+
+ FullWidth = x.Width;
+ ShortenedWidth = (FullWidth - ActiveLabelXYSeparation) / 2;
+
+ Y.Left = X.Left + ShortenedWidth + ActiveLabelXYSeparation;
+ Y.Width = ShortenedWidth;
+ Y.FormatString = ShortenedFormatString;
+
Combined = false;
SetCombined();
}
@@ -26,6 +35,10 @@ namespace grapher.Models.Options
public bool Combined { get; private set; }
+ private int FullWidth { get; }
+
+ private int ShortenedWidth { get; }
+
public void SetValues(double x, double y)
{
X.SetValue(x);
@@ -45,6 +58,9 @@ namespace grapher.Models.Options
{
if (!Combined)
{
+ X.FormatString = ActiveValueLabel.DefaultFormatString;
+ X.Width = FullWidth;
+ X.Prefix = string.Empty;
Y.Hide();
}
@@ -55,6 +71,10 @@ namespace grapher.Models.Options
{
if (Combined)
{
+ X.FormatString = ShortenedFormatString;
+ X.Width = ShortenedWidth;
+ X.Prefix = "X";
+ Y.Prefix = "Y";
Y.Show();
}