-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable downsampling in echarts #24311
Conversation
@@ -492,8 +492,8 @@ export class StatisticsChart extends LitElement { | |||
: this.hass.localize( | |||
`ui.components.statistics_charts.statistic_types.${type}` | |||
), | |||
symbol: "circle", | |||
symbolSize: 0, | |||
symbol: "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So stats chart points can not be highlighted anymore now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have there been points?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes? Although the size is set to 0... But then we have this code that sets it to none
for bands, that would not be needed anymore now then?
(series as LineSeriesOption).symbol = "none"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we can remove this or enable points again for stats.
symbolSize: 0
means they haven't had points since the migration and no one has complained so I don't think we need points for stats. Also the smoothing and the nature of the data makes it odd to have points
I tested it on desktop chrome & firefox and on iOS. I really feel the difference its so smooth now 🎉 |
* Enable downsampling in echarts * remove unneeded symbol set
Proposed change
Was finally able to look into what Chartjs did differently before. As I suspected, they have downsampling by default while in echarts it is disabled by default. This is the main reason for the performance difference.
There are a few sampling algorithms to choose from.
minmax
looks good to me butlttb
is also good.This change makes echarts 2x faster than ChartJS on my test data. 7 charts on the same page, 5 of them in same card, 1 chart with 85k datapoints.
Updates take
ChartsJS:
150ms
echarts:
70ms
down from300ms
Performance can be further improved by setting
symbol: "none"
for history charts but then points can't be highlighted.Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: