Switch items can be showed on a chart if you begin with the item definition analyze possibility and then save the chart. In the yaml code there is a markArea section that does the trick.
You can then customize the design or code.
The chart is saved with chart type ‘Dynamic period’. The code for my chart is:
config:
label: Garagepoort
period: W
slots:
grid:
- component: oh-chart-grid
config: {}
xAxis:
- component: oh-time-axis
config:
gridIndex: 0
yAxis:
- component: oh-value-axis
config:
gridIndex: 0
series:
- component: oh-time-series
config:
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: line
slots:
markArea:
- component: oh-mark-area
config:
item: Garagepoort
name: Garagepoort
I would like to see the chart in a weekly mode, starting on Monday. This doesn’t work: nothing is visible (well, sometimes there is something to see, but it is not the actual situation). And on the X-axis there are no time values.
The only difference in the yaml code is at the beginning:
config:
label: Garagepoort
chartType: isoWeek
Is there a reason for this? Is there a workaround?
Using OH 4.1.1 with Openhabian on a Raspberry pi 3B.