Fix chart preview (#24080)

* Fix chart preview

* Revert change to timeline-chart labels
This commit is contained in:
Petar Petrov 2025-02-05 16:16:16 +02:00 committed by GitHub
parent ad48732bb7
commit 6ff018afc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -529,6 +529,7 @@ export class HaChartBase extends LitElement {
:host {
display: block;
position: relative;
letter-spacing: normal;
}
.chart-container {
position: relative;

View File

@ -255,8 +255,7 @@ export class StateHistoryChartLine extends LitElement {
margin: 5,
formatter: (value: number) => {
const label = formatNumber(value, this.hass.locale);
// adding 5px extra because preview is not accurate #24027
const width = measureTextWidth(label, 12) + 5 + 5;
const width = measureTextWidth(label, 12) + 5;
if (width > this._yWidth) {
this._yWidth = width;
fireEvent(this, "y-width-changed", {