Hello, everyone,
I’m in the process of writing an editable chart widget for the UI.
But I have the problem that certain data from the props are not taken over.
On the one screenshot you can see that instead of the value of the props.period, the code itself is displayed in the chart.
Does anyone know the problem and maybe already has a solution for it?
uid: Chart-Card
tags: []
props:
parameters:
- description: Chart heading
label: Title
name: title
required: false
type: TEXT
- description: Unit for the X axis.
label: Unit
name: unit
required: true
type: TEXT
- default: D
description: Period for Y axis. See openHAB doc oh-chart for options.
label: Period
name: period
required: false
type: TEXT
- description: A name which will appear on tooltips and labels for item 1.
label: Item name 1
name: name1
required: false
type: TEXT
- context: item
description: The item 1 whose persisted data to display.
label: Item 1
name: item1
required: true
type: TEXT
- default: "1"
description: The type (Line, Bar, Heatmap, Scatter) of the series.
label: Type item 1
name: type1
required: false
type: INTEGER
min: 1
max: 4
- description: A name which will appear on tooltips and labels for item 2.
label: Item name 2
name: name2
required: false
type: TEXT
- context: item
description: The item 2 whose persisted data to display.
label: Item 2
name: item2
required: false
type: TEXT
- default: "1"
description: The type (Line, Bar, Heatmap, Scatter) of the series.
label: Type item 2
name: type2
required: false
type: INTEGER
min: 1
max: 4
- description: A name which will appear on tooltips and labels for item 3.
label: Item name 3
name: name3
required: false
type: TEXT
- context: item
description: The item 3 whose persisted data to display.
label: Item 3
name: item3
required: false
type: TEXT
- default: "1"
description: The type (Line, Bar, Heatmap, Scatter) of the series.
label: Type item 3
name: type3
required: false
type: INTEGER
min: 1
max: 4
- description: A name which will appear on tooltips and labels for item 4.
label: Item name 4
name: name4
required: false
type: TEXT
- context: item
description: The item 4 whose persisted data to display.
label: Item 4
name: item4
required: false
type: TEXT
- default: "1"
description: The type (Line, Bar, Heatmap, Scatter) of the series.
label: Type item 4
name: type4
required: false
type: INTEGER
min: 1
max: 4
- description: A name which will appear on tooltips and labels for item 5.
label: Item name 5
name: name5
required: false
type: TEXT
- context: item
description: The item 5 whose persisted data to display.
label: Item 5
name: item5
required: false
type: TEXT
- default: "1"
description: The type (Line, Bar, Heatmap, Scatter) of the series.
label: Type item 5
name: type5
required: false
type: INTEGER
min: 1
max: 4
parameterGroups: []
timestamp: Aug 2, 2022, 7:42:18 PM
component: f7-card
config:
title: =props.title
slots:
default:
- component: oh-chart
config:
chartType: ""
period: =props.period
slots:
grid:
- component: oh-chart-grid
config:
includeLabels: true
xAxis:
- component: oh-time-axis
config:
gridIndex: 0
yAxis:
- component: oh-value-axis
config:
gridIndex: 0
name: =props.unit
- component: oh-value-axis
config:
gridIndex: 0
series:
- component: oh-time-series
config:
name: =props.name1
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: =props.type1
item: =props.item1
- component: oh-time-series
config:
name: =props.name2
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: =props.type2
item: =props.item2
- component: oh-time-series
config:
name: =props.name3
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: =props.type3
item: =props.item3
tooltip:
- component: oh-chart-tooltip
config:
confine: true
smartFormatter: true
legend:
- component: oh-chart-legend
config:
bottom: 3
type: scroll
dataZoom:
- component: oh-chart-datazoom
config:
type: inside
I have one additional question. Is it now possible to expand the props dynamically (repeat/loop)?
Best regards,
Björn
- Platform information:
- Hardware: Raspberry Pi 4
- OS: Raspbian GNU/Linux 11 (bullseye)
- Java Runtime Environment: openjdk version 1.8.0_312
- openHAB version: openHAB 3.3.0 - Release Build