mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix statistic chart tooltip values (#24074)
This commit is contained in:
parent
fe041e442d
commit
f0507a88a6
@ -198,14 +198,17 @@ export class StatisticsChart extends LitElement {
|
|||||||
const statisticId = this._statisticIds[param.seriesIndex];
|
const statisticId = this._statisticIds[param.seriesIndex];
|
||||||
const stateObj = this.hass.states[statisticId];
|
const stateObj = this.hass.states[statisticId];
|
||||||
const entry = this.hass.entities[statisticId];
|
const entry = this.hass.entities[statisticId];
|
||||||
const stateValue = String(param.value[1]);
|
// max series can have 3 values, as the second value is the max-min to form a band
|
||||||
|
const rawValue = String(param.value[2] ?? param.value[1]);
|
||||||
|
|
||||||
const value = stateObj
|
const options = getNumberFormatOptions(stateObj, entry) ?? {
|
||||||
? this.hass.formatEntityState(stateObj, stateValue)
|
maximumFractionDigits: 2,
|
||||||
: `${formatNumber(
|
};
|
||||||
stateValue,
|
|
||||||
|
const value = `${formatNumber(
|
||||||
|
rawValue,
|
||||||
this.hass.locale,
|
this.hass.locale,
|
||||||
getNumberFormatOptions(undefined, entry)
|
options
|
||||||
)}${unit}`;
|
)}${unit}`;
|
||||||
|
|
||||||
const time =
|
const time =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user