mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Limit height of charts to 400px (#9487)
This commit is contained in:
parent
4466950bb8
commit
36c20e4348
@ -20,7 +20,7 @@ interface Tooltip extends TooltipModel<any> {
|
|||||||
export default class HaChartBase extends LitElement {
|
export default class HaChartBase extends LitElement {
|
||||||
public chart?: Chart;
|
public chart?: Chart;
|
||||||
|
|
||||||
@property()
|
@property({ attribute: "chart-type", reflect: true })
|
||||||
public chartType: ChartType = "line";
|
public chartType: ChartType = "line";
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
@ -228,6 +228,9 @@ export default class HaChartBase extends LitElement {
|
|||||||
height: 0;
|
height: 0;
|
||||||
transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
|
:host(:not([chart-type="timeline"])) canvas {
|
||||||
|
max-height: 400px;
|
||||||
|
}
|
||||||
.chartLegend {
|
.chartLegend {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class StateHistoryChartLine extends LitElement {
|
|||||||
<ha-chart-base
|
<ha-chart-base
|
||||||
.data=${this._chartData}
|
.data=${this._chartData}
|
||||||
.options=${this._chartOptions}
|
.options=${this._chartOptions}
|
||||||
chartType="line"
|
chart-type="line"
|
||||||
></ha-chart-base>
|
></ha-chart-base>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ export class StateHistoryChartTimeline extends LitElement {
|
|||||||
<ha-chart-base
|
<ha-chart-base
|
||||||
.data=${this._chartData}
|
.data=${this._chartData}
|
||||||
.options=${this._chartOptions}
|
.options=${this._chartOptions}
|
||||||
chartType="timeline"
|
chart-type="timeline"
|
||||||
></ha-chart-base>
|
></ha-chart-base>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user