mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Respect sensor precision setting when rendering line chart tooltips (#17648)
This commit is contained in:
parent
ac3e858738
commit
53f18bec53
@ -7,6 +7,7 @@ import { computeRTL } from "../../common/util/compute_rtl";
|
|||||||
import {
|
import {
|
||||||
formatNumber,
|
formatNumber,
|
||||||
numberFormatToLocale,
|
numberFormatToLocale,
|
||||||
|
getNumberFormatOptions,
|
||||||
} from "../../common/number/format_number";
|
} from "../../common/number/format_number";
|
||||||
import { LineChartEntity, LineChartState } from "../../data/history";
|
import { LineChartEntity, LineChartState } from "../../data/history";
|
||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
@ -125,7 +126,13 @@ class StateHistoryChartLine extends LitElement {
|
|||||||
label: (context) =>
|
label: (context) =>
|
||||||
`${context.dataset.label}: ${formatNumber(
|
`${context.dataset.label}: ${formatNumber(
|
||||||
context.parsed.y,
|
context.parsed.y,
|
||||||
this.hass.locale
|
this.hass.locale,
|
||||||
|
getNumberFormatOptions(
|
||||||
|
this.hass.states[this.data[context.datasetIndex].entity_id],
|
||||||
|
this.hass.entities[
|
||||||
|
this.data[context.datasetIndex].entity_id
|
||||||
|
]
|
||||||
|
)
|
||||||
)} ${this.unit}`,
|
)} ${this.unit}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user