Hi,
I’ve made a custom widget which is a chart in a card. I wanted to make it general so that I could specify the title, the item and the Y axis units in the props.
The title and the item work correctrly, but the name of the yAxis doesn’t.
This is the code:
uid: Chart Card
tags: []
props:
parameters:
- description: Title of the chart
label: Title
name: title
required: false
type: TEXT
- context: item
description: Item in chart
label: Item in chart
name: item
required: true
type: TEXT
- description: Units in Y axis
label: Units
name: units
required: false
parameterGroups: []
timestamp: Feb 21, 2023, 11:33:35 AM
component: f7-card
config:
title: =props.title
slots:
default:
- component: oh-chart
config:
chartType: ""
label: =props.title
period: D
slots:
dataZoom:
- component: oh-chart-datazoom
config:
type: inside
grid:
- component: oh-chart-grid
config:
includeLabels: true
legend:
- component: oh-chart-legend
config:
bottom: 3
type: scroll
series:
- component: oh-time-series
config:
areaStyle:
opacity: 0.2
gridIndex: 0
item: =props.item
name: =props.title
type: line
xAxisIndex: 0
yAxisIndex: 0
tooltip:
- component: oh-chart-tooltip
config:
confine: true
smartFormatter: true
xAxis:
- component: oh-time-axis
config:
gridIndex: 0
yAxis:
- component: oh-value-axis
config:
gridIndex: 0
name: =props.units
- component: oh-value-axis
config:
gridIndex: 0
And I get this:
Notice “=props.units” in the graph when I set the prop “units” to “kWh”.
Am I doing anything wrong or it isn’t possible?
Thanks.