#Multiple sensor values arranged to a bar chart
1 messages · Page 1 of 1 (latest)
Bumping this I guess as I have the same question
I'd like to display the daily forecasted energy prices as a bar chart.
I have 1 sensor for each hour of the day, and would just like to display their current value as a datapoint in a static bar chart
Currently I'm having to display it like this which is no good and is hard to read
Not in the default charts. You will need a custom chart card of some sort. Eg. I use custom:apexcharts-card and a pie chart to visualise quantitative data without the time series.
Ah, would you be able to share the yaml for that? I'd love to see how you did it
Sure.
In the card:
type: custom:apexcharts-card
config_templates: donut
all_series_config:
unit: " "
header:
title: Devices by Integration
series:
- entity: sensor.home_assistant_devices_by_integration
attribute: zha
name: Zigbee
- entity: sensor.home_assistant_devices_by_integration
attribute: esphome
name: ESPHome
- entity: sensor.home_assistant_devices_by_integration
attribute: localtuya
name: LocalTuya
- entity: sensor.home_assistant_devices_by_integration
attribute: broadlink
name: Broadlink
- entity: sensor.home_assistant_devices_by_integration
attribute: switchbot
name: Switchbot
- entity: sensor.home_assistant_devices_by_integration
name: Others
transform: >-
return entity.state - entity.attributes.zha - entity.attributes.esphome -
entity.attributes.localtuya - entity.attributes.broadlink -
entity.attributes.switchbot
color: grey
And in your dashboard in yaml mode, to configure the config_templates referenced in the card:
apexcharts_card_templates:
standard:
header:
show: true
show_states: true
colorize_states: true
graph_span: 4h
apex_config:
grid:
show: false
chart:
stackOnlyBar: false
all_series_config:
curve: stepline
stroke_width: 2
show:
legend_value: false
donut:
config_templates: standard
chart_type: donut
all_series_config:
show:
datalabels: percent
apex_config:
legend:
show: false
dataLabels:
formatter: |
EVAL:function(x) {
return Math.round(x) + '%'
}