Has anyone successfully added both a column and a stepline graph on top of each other? Both should align correctly on the x-axis, but in my case, they appear offset.
What I want:
What I get:
My code:
type: custom:config-template-card
variables:
- "\"sensor.nordpool_energy_prices\""
- Number(states['sensor.nordpool_energy_prices'].state)
- >-
String('Pris just nu ' +
Number(states['sensor.nordpool_energy_prices'].state) + ' öre/kWh')
- Number(states['sensor.nordpool_energy_prices'].attributes.average)
- >-
(((states['sensor.nordpool_energy_prices'].attributes.max -
states['sensor.nordpool_energy_prices'].attributes.min) / 4) * 0) +
Number(states['sensor.nordpool_energy_prices'].attributes.min)
- >-
(((states['sensor.nordpool_energy_prices'].attributes.max -
states['sensor.nordpool_energy_prices'].attributes.min) / 4) * 1) +
Number(states['sensor.nordpool_energy_prices'].attributes.min)
- >-
(((states['sensor.nordpool_energy_prices'].attributes.max -
states['sensor.nordpool_energy_prices'].attributes.min) / 4) * 2) +
Number(states['sensor.nordpool_energy_prices'].attributes.min)
- >-
(((states['sensor.nordpool_energy_prices'].attributes.max -
states['sensor.nordpool_energy_prices'].attributes.min) / 4) * 3) +
Number(states['sensor.nordpool_energy_prices'].attributes.min)
- String(states['sensor.nordpool_energy_prices'].state)
entities: ${vars[0]}
card:
type: custom:apexcharts-card
experimental:
color_threshold: true
graph_span: 24h
hours_12: false
header:
title: ${vars[2]}
show: true
span:
start: day
now:
show: true
label: ${String(vars[8])}
apex_config:
xaxis:
type: datetime
series:
- entity: ${vars[0]}
type: column
stroke_width: 1
data_generator: |
return entity.attributes.times.map((time, index) => {
return [new Date(time).getTime(), entity.attributes.prices[index]];
});
color_threshold:
- value: ${vars[4]}
color: "#ffffff"
- value: ${vars[5]}
color: "#fad5ad"
- value: ${vars[6]}
color: "#fabe7e"
- value: ${vars[7]}
color: "#ff9c33"
- entity: ${vars[0]}
type: line
curve: stepline
stroke_width: 1
data_generator: |
return entity.attributes.times.map((time, index) => {
return [new Date(time).getTime(), entity.attributes.prices[index]];
});
yaxis:
- id: ore
decimals: 2
apex_config:
tickAmount: 10