From 176eac82b3bc08166e0960742868ce1646cc615c Mon Sep 17 00:00:00 2001 From: Jose Farias Date: Sat, 20 Apr 2024 13:12:33 -0600 Subject: [PATCH] Match tooltip designs --- .../time_series_chart_controller.js | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/app/javascript/controllers/time_series_chart_controller.js b/app/javascript/controllers/time_series_chart_controller.js index 6717110f..e557276c 100644 --- a/app/javascript/controllers/time_series_chart_controller.js +++ b/app/javascript/controllers/time_series_chart_controller.js @@ -248,22 +248,28 @@ export default class extends Controller { ${d3.timeFormat("%b %d, %Y")(data.date)} -
- - - +
+
+ + + - ${this.#tooltipValue(data)} + ${this.#tooltipValue(data)} +
- - ${this.#tooltipChange(data)} (${data.trend.percent}%) - + ${data.trend.value == 0 || data.trend.value.amount == 0 ? ` + + ` : ` + + ${this.#tooltipChange(data)} (${data.trend.percent}%) + + `}
`) }