Skip to content

Commit

Permalink
Hide trend value from hover
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Dec 4, 2024
1 parent 6316656 commit 6913340
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/graphs/IndicatorGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ const createTraces: (params: CreateTracesParams) => TracesOutput = (params) => {
modTrace.cliponaxis = false;
}
}
const timeFormat = timeResolution === 'YEAR' ? '%Y' : '%x';
modTrace.hovertemplate = `(%{x|${timeFormat}})<br> ${trace.name}: %{y:,.3r} ${unit}`;
//const timeFormat = timeResolution === 'YEAR' ? '%Y' : '%x';
modTrace.hovertemplate = `${trace.name}: %{y:,.3r} ${unit}`;
modTrace.hoverlabel = {
bgcolor: plotColors.mainScale[idx % numColors],
namelength: 0,
Expand Down Expand Up @@ -529,6 +529,7 @@ function IndicatorGraph(props: IndicatorGraphProps) {
},
//info: 'none',
...trendTrace,
hoverinfo: 'skip',
});

// add goals if defined
Expand All @@ -553,7 +554,7 @@ function IndicatorGraph(props: IndicatorGraphProps) {
color: plotColors.goalScale[idx % plotColors.goalScale.length],
},
opacity: 0.5,
hovertemplate: `(%{x}) ${goalTrace.name}: %{y} ${yRange.unit}`,
hovertemplate: `${goalTrace.name}: %{y} ${yRange.unit}`,
hoverlabel: {
namelength: 0,
bgcolor: '#fff',
Expand Down

0 comments on commit 6913340

Please sign in to comment.