standardize chart values to two decimals

This commit is contained in:
Henry Dollman
2024-09-03 16:49:12 -04:00
parent 202a506485
commit af4c05e692
14 changed files with 58 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ import {
cn,
formatShortDate,
toFixedWithoutTrailingZeros,
twoDecimalString,
useYaxisWidth,
} from '@/lib/utils'
import { useStore } from '@nanostores/react'
@@ -102,8 +103,8 @@ export default function TemperatureChart({
itemSorter={(a, b) => b.value - a.value}
content={
<ChartTooltipContent
unit=" °C"
labelFormatter={(_, data) => formatShortDate(data[0].payload.created)}
contentFormatter={(item) => twoDecimalString(item.value) + ' °C'}
indicator="line"
/>
}