Charts in card widgets?

Hello,

i tried to add a chart into a card widget but i just get an empty space as result. Is it possible to add charts to card widgets?
I created a chart page and copied the code from the chart into a new custom widget:

uid: widget_wan_connection
tags: []
props:
  parameters:
    - context: text
      description: An item to control
      label: Titel
      name: title
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: WAN Downstream
      name: downstream
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: WAN Upstream
      name: upstream
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Mar 22, 2021, 9:59:57 AM
component: oh-chart
config:
  label: WAN1 Bandbreite
  period: D
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
        item: SNMPDrayTekVigor165_WANDownstream
        name: Downstream
    - component: oh-time-series
      config:
        name: Upstream
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: line
        item: SNMPDrayTekVigor165_WANUpstream
  title:
    - component: oh-chart-title
      config:
        show: true
        text: Bandbreite WAN1

Hey @e36Alex

Yes it is and the general strucutre looks good to me. Maybe these items does not received any data yet?

You could check this with:
http://YOUR_OH_IP:8080/rest/persistence/items/SNMPDrayTekVigor165_WANDownstream

The data is avaible. In the “original” chart the values are shown correct.

I even get the data with posted url:

Hmm, strange… which oh-version you are using?

The oh-chart component as part of the pages view was introduced at the end of January 2021. Besides that, I’ve no valid idea what is happening on your side.

As it doesn’t hurt, you could try to give the OH service a restart.

I am using the latest stable version 3.0.1.

It seems that the oh-chart component was introduced with OH 3.1.0 M1. So you have to wait for the next stable release or updating to the latest Milestone or snapshot build .

Thanks for that information! I think i will wait for the next stable release.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.