Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow oh-repeater in oh-chart components: grid, xAxis, yAxis, series, oh-chart-tooltip, dataZoom, and others #2361

Open
proggprod opened this issue Feb 16, 2024 · 0 comments
Labels
bug Something isn't working main ui Main UI

Comments

@proggprod
Copy link

The problem

I can't use oh-repeater to propagate components of oh-chart

Expected behavior

The oh-chart components should accept oh-repeater in the slots.

I should be able to create a list of charts with the following code that looks like this:
image

uid: motionHistory_repeatertest
tags: []
props:
  parameters: []
  parameterGroups: []
timestamp: Feb 16, 2024, 12:45:25 PM
component: f7-card
config:
  noShadow: true
slots:
  default:
    - component: oh-chart
      config:
        period: 6H
      slots:
        grid:
          - component: oh-repeater
            config:
              for: grids
              sourceType: itemsInGroup
              groupItem: gAll_MotionLightSensor_Motion
            slots:
              default:
                - component: oh-chart-grid
                  config:
                    top: =50 + (loop.grids_idx * 20)
                    left: 120
                    right: 20
                    height: 20
        xAxis:
          - component: oh-repeater
            config:
              for: xAx
              sourceType: itemsInGroup
              groupItem: gAll_MotionLightSensor_Motion
            slots:
              default:
                - component: oh-time-axis
                  config:
                    gridIndex: =loop.xAx_idx
                    axisLabel:
                      show: false
                    axisTick:
                      show: false
        yAxis:
          - component: oh-repeater
            config:
              for: yAx
              sourceType: itemsInGroup
              groupItem: gAll_MotionLightSensor_Motion
            slots:
              default:
                - component: oh-value-axis
                  config:
                    gridIndex: =loop.yAx_idx
                    name: =loop.yAx.label
                    nameGap: -20
                    position: left
                    offset: 10
                    nameTextStyle:
                      align: right
        series:
          - component: oh-repeater
            config:
              for: series
              sourceType: itemsInGroup
              groupItem: gAll_MotionLightSensor_Motion
            slots:
              default:
                - component: oh-time-series
                  config:
                    gridIndex: =loop.grids_idx
                    xAxisIndex: =loop.xAx_idx
                    yAxisIndex: =loop.yAx_idx
                    type: line
                  slots:
                    markArea:
                      - component: oh-mark-area
                        config:
                          item: =loop.series.name

Additional information

Mentioned here
https://community.openhab.org/t/oh-repeater-not-working-for-oh-time-series-in-oh-chart/123392/3
https://community.openhab.org/t/colored-graph-support-for-switch-contact-and-text-items/141024
https://community.openhab.org/t/oh-chart-multiple-switch-items-timeline-widget/153947

@proggprod proggprod added bug Something isn't working main ui Main UI labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

No branches or pull requests

1 participant