From 5b0a3c3e10d4d05163fb91bdda183969a53bd20d Mon Sep 17 00:00:00 2001
From: Aaron Briggs <abriggs@contractor.usgs.gov>
Date: Wed, 13 Jul 2022 15:30:13 -0500
Subject: [PATCH] working as expected

---
 .../components/hydrograph/selectors/cursor.js       |  4 ++--
 .../components/hydrograph/tooltip.js                |  7 ++++++-
 assets/src/styles/components/hydrograph/_app.scss   | 13 +++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js
index 799db790a..f883eaab8 100644
--- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js
+++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/cursor.js
@@ -7,7 +7,7 @@ import {getGraphCursorOffset} from 'ml/selectors/hydrograph-state-selector';
 
 import {getGroundwaterLevelPoints} from './discrete-data';
 import {getIVDataPoints} from './iv-data';
-import {getMainXScale, getMainYScale, getGraphTimeRange} from './scales';
+import {getMainXScale, getMainYScale, getYScale, getGraphTimeRange} from './scales';
 import {isVisible} from './time-series-data';
 
 const isInTimeRange = function(dateTime, timeRange) {
@@ -83,7 +83,7 @@ export const getIVDataCursorPoint = memoize((dataKind, timeRangeKind) => createS
  */
 export const getIVDataTooltipPoint = memoize((dataKind, timeRangeKind) => createSelector(
     getMainXScale(timeRangeKind),
-    getMainYScale,
+    getYScale('MAIN', dataKind),
     getIVDataCursorPoint(dataKind, timeRangeKind),
     (xScale, yScale, cursorPoint) => {
         if (cursorPoint && isFinite(yScale(cursorPoint.value))) {
diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js
index d07d5c0cc..21a5d340a 100644
--- a/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js
+++ b/assets/src/scripts/monitoring-location/components/hydrograph/tooltip.js
@@ -132,19 +132,24 @@ export const drawTooltipFocus = function(elem, store) {
 
     elem.call(link(store, drawFocusCircles, createSelector(
         getIVDataTooltipPoint('primary', 'current'),
+        getIVDataTooltipPoint('secondary', 'current'),
         getIVDataTooltipPoint('compare', 'prioryear'),
         getGroundwaterLevelTooltipPoint,
-        (current, compare, gwLevel) => {
+        (current, secondary, compare, gwLevel) => {
             let points = [];
             if (current) {
                 points.push(current);
             }
+            if (secondary) {
+                points.push(secondary);
+            }
             if (compare) {
                 points.push(compare);
             }
             if (gwLevel) {
                 points.push(gwLevel);
             }
+
             return points;
         }
     )));
diff --git a/assets/src/styles/components/hydrograph/_app.scss b/assets/src/styles/components/hydrograph/_app.scss
index 691f40d7c..c584a9272 100644
--- a/assets/src/styles/components/hydrograph/_app.scss
+++ b/assets/src/styles/components/hydrograph/_app.scss
@@ -218,6 +218,19 @@
         }
       }
 
+      .secondary-tooltip-text {
+        font-weight: normal;
+        color: variables.$default-time-series;
+
+        &.approved {
+          color: variables.$approved-time-series;
+        }
+
+        &.estimated {
+          color: variables.$estimated-time-series;
+        }
+      }
+
       .compare-tooltip-text {
         font-weight: normal;
         color: variables.$default-time-series-compare;
-- 
GitLab