1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 12:49:19 +00:00

Limit height of charts to 400px (#9487)

This commit is contained in:
Bram Kragten
2021-07-01 07:54:17 +02:00
committed by GitHub
parent 4466950bb8
commit 36c20e4348
3 changed files with 6 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ interface Tooltip extends TooltipModel<any> {
export default class HaChartBase extends LitElement {
public chart?: Chart;
@property()
@property({ attribute: "chart-type", reflect: true })
public chartType: ChartType = "line";
@property({ attribute: false })
@@ -228,6 +228,9 @@ export default class HaChartBase extends LitElement {
height: 0;
transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
:host(:not([chart-type="timeline"])) canvas {
max-height: 400px;
}
.chartLegend {
text-align: center;
}

View File

@@ -30,7 +30,7 @@ class StateHistoryChartLine extends LitElement {
<ha-chart-base
.data=${this._chartData}
.options=${this._chartOptions}
chartType="line"
chart-type="line"
></ha-chart-base>
`;
}

View File

@@ -98,7 +98,7 @@ export class StateHistoryChartTimeline extends LitElement {
<ha-chart-base
.data=${this._chartData}
.options=${this._chartOptions}
chartType="timeline"
chart-type="timeline"
></ha-chart-base>
`;
}