[chronojump] jumpsRjFatigue average lines with tips and gray99



commit 83f66a0f0e7af62aea24eb4ccfe13c6eeb6d788b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Aug 17 21:49:53 2020 +0100

    jumpsRjFatigue average lines with tips and gray99

 src/gui/cairo/jumpsRjFatigue.cs | 22 +++++++++++++++++-----
 src/gui/cairo/xy.cs             |  8 ++++++--
 2 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/cairo/jumpsRjFatigue.cs b/src/gui/cairo/jumpsRjFatigue.cs
index 479c6bfe..f7791a81 100644
--- a/src/gui/cairo/jumpsRjFatigue.cs
+++ b/src/gui/cairo/jumpsRjFatigue.cs
@@ -80,9 +80,10 @@ public class JumpsRjFatigueGraph : CairoXY
 
                g.Color = red;
                plotPredictedLine(predictedLineTypes.STRAIGHT, predictedLineCrossMargins.TOUCH);
-               g.Color = black;
-
+               //g.Color = black;
+               g.Color = gray99;
                divideAndPlotAverage(divideIn);
+               g.Color = black;
 
                plotRealPoints(true);
 
@@ -132,11 +133,22 @@ public class JumpsRjFatigueGraph : CairoXY
 
        private void paintHorizSegment (double xa, double xb, double y)
        {
-               g.MoveTo(calculatePaintX(xa), calculatePaintY(y));
-               g.LineTo(calculatePaintX(xb), calculatePaintY(y));
+               double xap = calculatePaintX(xa);
+               double xbp = calculatePaintX(xb);
+               double yp = calculatePaintY(y);
+
+               g.MoveTo(xap, yp);
+               g.LineTo(xbp, yp);
+
+               //paint also small y marks
+               g.MoveTo(xap, yp - pointsRadius);
+               g.LineTo(xap, yp + pointsRadius);
+               g.MoveTo(xbp, yp - pointsRadius);
+               g.LineTo(xbp, yp + pointsRadius);
+
                printText(
                                graphWidth - outerMargins,
-                               Convert.ToInt32(calculatePaintY(y)),
+                               Convert.ToInt32(yp),
                                0, textHeight, Util.TrimDecimals(y, 2), g, alignTypes.CENTER);
 
                g.Stroke ();
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index 9909c90a..dfeded6e 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -54,6 +54,7 @@ public abstract class CairoXY
 
        protected Cairo.Context g;
        protected const int textHeight = 12;
+       protected const int pointsRadius = 6;
        protected string xVariable = "";
        protected string yVariable = "";
        protected string xUnits = "";
@@ -70,6 +71,7 @@ public abstract class CairoXY
        protected int graphHeight;
 
        protected Cairo.Color black;
+       protected Cairo.Color gray99;
        Cairo.Color white;
        protected Cairo.Color red;
        Cairo.Color blue;
@@ -121,6 +123,7 @@ public abstract class CairoXY
                g.SetFontSize(textHeight);
 
                black = colorFromRGB(0,0,0);
+               gray99 = colorFromRGB(99,99,99);
                white = colorFromRGB(255,255,255);
                red = colorFromRGB(200,0,0);
                blue = colorFromRGB(178, 223, 238); //lightblue
@@ -406,7 +409,7 @@ public abstract class CairoXY
                {
                        double xgraph = calculatePaintX(p.X);
                        double ygraph = calculatePaintY(p.Y);
-                       g.Arc(xgraph, ygraph, 6.0, 0.0, 2.0 * Math.PI); //full circle
+                       g.Arc(xgraph, ygraph, pointsRadius, 0.0, 2.0 * Math.PI); //full circle
                        g.Color = blue;
                        g.FillPreserve();
                        g.SetSourceRGB(0, 0, 0);
@@ -518,7 +521,8 @@ public abstract class CairoXY
 
                // 5) paint rectangle around that point
                g.Color = bluePlots;
-               g.Rectangle(calculatePaintX(pClosest.X) -12, calculatePaintY(pClosest.Y) -12, 24, 24);
+               g.Rectangle(calculatePaintX(pClosest.X) - 2*pointsRadius, calculatePaintY(pClosest.Y) 
-2*pointsRadius,
+                               4*pointsRadius, 4*pointsRadius);
                g.Stroke();
                g.Color = black;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]