mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Fix chart preview (#24080)
* Fix chart preview * Revert change to timeline-chart labels
This commit is contained in:
parent
6487b9b7ea
commit
f2e35dc70a
@ -524,6 +524,7 @@ export class HaChartBase extends LitElement {
|
|||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
letter-spacing: normal;
|
||||||
}
|
}
|
||||||
.chart-container {
|
.chart-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -255,8 +255,7 @@ export class StateHistoryChartLine extends LitElement {
|
|||||||
margin: 5,
|
margin: 5,
|
||||||
formatter: (value: number) => {
|
formatter: (value: number) => {
|
||||||
const label = formatNumber(value, this.hass.locale);
|
const label = formatNumber(value, this.hass.locale);
|
||||||
// adding 5px extra because preview is not accurate #24027
|
const width = measureTextWidth(label, 12) + 5;
|
||||||
const width = measureTextWidth(label, 12) + 5 + 5;
|
|
||||||
if (width > this._yWidth) {
|
if (width > this._yWidth) {
|
||||||
this._yWidth = width;
|
this._yWidth = width;
|
||||||
fireEvent(this, "y-width-changed", {
|
fireEvent(this, "y-width-changed", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user