实体的属性格式是这样的:
使用apexcharts-card图表如何显示,麻烦大神帮忙改一下代码:
type: custom:apexcharts-card
header:
show: true
title: 当月用电趋势图
show_states: true
colorize_states: true
graph_span: 31d
span:
start: month
series:
- entity: sensor.0308300234854862_this_month_total_usage
data_generator: |
return entity.attributes.this_month_by_day.map((peak, index) => {
return [new Date(peak).getTime(), entity.attributes.this_month_by_day[index]];
});
|