Is it possible to create an logarithmic y-axis?

Hi,

I am trying to create a logarithmic y-axis but have no luck. The code is as follow:

config:
  chartType: ""
  period: D
  label: FRITZBox Traffic
  sidebar: true
  order: "3000"
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: Bit / s
        nameLocation: center
        nameGap: 40
        type: log
        logBase: 10
  series:
    - component: oh-time-series
      config:
        name: Download
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: bar
        item: WANDevice_FRITZBox_7490_TotalReceived_Bit_per_second
        color: green
  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

Did anyone had success in plotting logarithmic chart axes using OpenHab 3? Any hint is highly appreciated.

I am using OpenHab 3.2.0 and RRD for persistence.

Maja

I don’t believe this is currently possible. For the oh-value-axis the axis type is fixed at value and your widget yaml is not going to override that.

Thank for your answer!
Hm, this would be good to have logarithmic axis as a feature in OH charts.

Actually I don’t understand why OH is limiting the features of echarts. Is there any reason for this? Or is there a way to sneak around this limitation by using echarts directly?

I don’t know for sure and can only speculate. My guess is that the built-in charting in MainUI is really only ever supposed to be simple. There are so many other solutions out there, e.g. Grafana, that can be used if advanced charting is required that it’s simply not worth the effort to try and integrate a more advanced solution directly into the UI.

I’m sure there is, but I have never tried so I can’t really help there.

Ok, fine by now. Thanks for your thoughts! I shall checkout other graphing tool then.

You can actually set up any ECharts options directly like this:

component: oh-chart-page
config:
  options:
    ...
slots:
  yAxis:
    ...

the problem is this syntax:

prevents the standard root-level options (grid, xAxis, yAxis etc.) to be overridden by what’s in the options config object. It would not be the case if that ...chartConfig had been at the end, so it’s an easy fix.

@ysc thanks for this interesting insights. Unfortunately I was not able to define the yAxis logarithmic.
Could you please extend the first code block example in your previous post?
I tried to move the yAxis definition below options: , see below, but this could not be parsed by OH.

config:
  period: D
  label: FRITZBox Traffic
  sidebar: true
  order: "3000"
  options:
    yAxis:
      - component: oh-value-axis
        config:
          gridIndex: 0
          type: log
          logBase: 1024
          name: Bit / s
          nameLocation: center
          nameGap: 40
slots:
  grid:
    - component: oh-chart-grid
      config:
        includeLabels: true
  xAxis:
    - component: oh-time-axis
      config:
        gridIndex: 0
  series:
    - component: oh-time-series
      config:
        name: Download
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: line
        item: WANDevice_FRITZBox_7490_TotalReceived_Bit_per_second
        color: green
        markLine:
          data:
            - type: average
        markPoint:
          label:
            backgroundColor: auto
          data:
            - type: max
              name: max

May be the syntax I used was wrong or do you mean the fix would be possible but your suggestion does not work in OH 3.2?