mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Enable downsampling in echarts (#24311)
* Enable downsampling in echarts * remove unneeded symbol set
This commit is contained in:
parent
2801d071ba
commit
ad487470fd
@ -521,14 +521,14 @@ export class HaChartBase extends LitElement {
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
if (dataSize > 10000) {
|
if (dataSize > 10000) {
|
||||||
// for large datasets zr.flush takes 30-40% of the render time
|
// delay the last bit of the render to avoid blocking the main thread
|
||||||
// so we delay it a bit to avoid blocking the main thread
|
// this is not that impactful with sampling enabled but it doesn't hurt to have it
|
||||||
const zr = this.chart.getZr();
|
const zr = this.chart.getZr();
|
||||||
this._originalZrFlush = zr.flush.bind(zr);
|
this._originalZrFlush = zr.flush;
|
||||||
zr.flush = () => {
|
zr.flush = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._originalZrFlush?.();
|
this._originalZrFlush?.call(zr);
|
||||||
}, 10);
|
}, 5);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -354,9 +354,10 @@ export class StateHistoryChartLine extends LitElement {
|
|||||||
name: nameY,
|
name: nameY,
|
||||||
color,
|
color,
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
step: "end",
|
|
||||||
animationDurationUpdate: 0,
|
|
||||||
symbolSize: 1,
|
symbolSize: 1,
|
||||||
|
step: "end",
|
||||||
|
sampling: "minmax",
|
||||||
|
animationDurationUpdate: 0,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: fill ? 0 : 1.5,
|
width: fill ? 0 : 1.5,
|
||||||
},
|
},
|
||||||
|
@ -492,8 +492,8 @@ export class StatisticsChart extends LitElement {
|
|||||||
: this.hass.localize(
|
: this.hass.localize(
|
||||||
`ui.components.statistics_charts.statistic_types.${type}`
|
`ui.components.statistics_charts.statistic_types.${type}`
|
||||||
),
|
),
|
||||||
symbol: "circle",
|
symbol: "none",
|
||||||
symbolSize: 0,
|
sampling: "minmax",
|
||||||
animationDurationUpdate: 0,
|
animationDurationUpdate: 0,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
@ -511,7 +511,6 @@ export class StatisticsChart extends LitElement {
|
|||||||
if (band && this.chartType === "line") {
|
if (band && this.chartType === "line") {
|
||||||
series.stack = `band-${statistic_id}`;
|
series.stack = `band-${statistic_id}`;
|
||||||
series.stackStrategy = "all";
|
series.stackStrategy = "all";
|
||||||
(series as LineSeriesOption).symbol = "none";
|
|
||||||
if (drawBands && type === "max") {
|
if (drawBands && type === "max") {
|
||||||
(series as LineSeriesOption).areaStyle = {
|
(series as LineSeriesOption).areaStyle = {
|
||||||
color: color + "3F",
|
color: color + "3F",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user