Skip to content

Commit

Permalink
fix time legend
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Ulyanov <[email protected]>
  • Loading branch information
vauweb committed Nov 27, 2024
1 parent 77080f9 commit cef328b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions statshouse-ui/src/components/UPlotWrapper/UPlotWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ function readLegend(u: uPlot): LegendItem[] {
if (idx / u.data[index].length < 0.9) {
deltaTime = ((u.data?.[0] && u.data[0][idx]) ?? 0) - xMax;
}
if (index === 0) {
lastTime =
(typeof s.value === 'function' ? s.value(u, u.data[index][idx], 0, idx) : s.value)
?.toString()
.replace('--', '') ?? ''; // replace '--' uplot
}
}
if (idx != null && index === 0) {
lastTime =
(typeof s.value === 'function' ? s.value(u, u.data[index][idx], 0, idx) : s.value)
?.toString()
.replace('--', '') ?? ''; // replace '--' uplot
}
return {
label: s.label ?? '',
Expand Down

0 comments on commit cef328b

Please sign in to comment.