TypeError: Cannot read properties of undefined (reading 'coordinateSystem') in charts

Openhab 3.3.0

I’ve created a chart for a persistent item I have but I get a JS error and no X axis or points rendered in the chart

with this error in the javascript console:

app.js:7 TypeError: Cannot read properties of undefined (reading 'coordinateSystem')
    at Object.r (12.app.js:1:88913)
    at e.render (39.app.js:1:32711)
    at 5.app.js:31:181974
    at Array.forEach (<anonymous>)
    at C (5.app.js:1:35349)
    at er (5.app.js:31:181911)
    at tr (5.app.js:31:181757)
    at e.update (5.app.js:31:177881)
    at e.setOption (5.app.js:31:167326)
    at i.init (5.app.js:31:261849)

I’m using mysql and checked that the databse is ok and has data in it

The chart is quite simple:

config:
  label: Batteries
  period: 2D
  sidebar: true
slots:
  calendar: []
  grid:
    - component: oh-chart-grid
      config: {}
  legend:
    - component: oh-chart-legend
      config:
        orient: horizontal
        show: true
  series:
    - component: oh-time-series
      config:
        gridIndex: 0
        item: plant1_bat
        name: plant1 battery
        type: line
        xAxisIndex: 0
        yAxisIndex: 0
  title:
    - component: oh-chart-title
      config:
        show: true
        text: Battery levels
  xAxis:
    - component: oh-time-axis
      config:
        gridIndex: 0
        name: Time
    - component: oh-time-axis
      config:
        gridIndex: 1
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
        name: Raw Battery reading
        scale: true
    - component: oh-value-axis
      config:
        gridIndex: 1

it’s getting data from this item:

Number plant1_bat "Plant1 Battery" (plant1, batteries)

I’m using jdbc with mysql:

jdbc:mysql://127.0.0.1:3306/plant_items?serverTimezone=EET

the table looks ok:

mysql> describe plant1_bat_0011;
+-------+-----------+------+-----+-------------------+-----------------------------+
| Field | Type      | Null | Key | Default           | Extra                       |
+-------+-----------+------+-----+-------------------+-----------------------------+
| time  | timestamp | NO   | PRI | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| value | double    | YES  |     | NULL              |                             |
+-------+-----------+------+-----+-------------------+-----------------------------+
2 rows in set (0.01 sec)


mysql> select * from plant1_bat_0011 ;
+---------------------+-------+
| time                | value |
+---------------------+-------+
| 2022-10-04 12:06:32 |   847 |
| 2022-10-04 12:10:33 |   848 |
| 2022-10-04 12:16:47 |   849 |
| 2022-10-04 12:22:57 |   848 |
| 2022-10-04 12:27:05 |   849 |
| 2022-10-04 12:29:08 |   850 |
| 2022-10-04 12:31:11 |   849 |
.....

and I can see that the chart is making a request to the persistence api which is returning data:

-> http://server.local:8080/rest/persistence/items/plant1_temp?starttime=2022-09-27T20%3A26%3A29.964Z&endtime=2022-10-04T20%3A26%3A29.963Z
{"name":"plant1_temp","datapoints":"259","data":[{"time":1664874391000,"state":"22.2"},{"time":1664874510000,"state":"22.6"},{"time":1664874633000,"state":"22.4"},

Anyone got any clues? I’ve tried it in Chromium Version 105.0.5195.102 (Official Build) snap (64-bit)
and firefox 92.0.

Anyone got any clues?

I don’t think it has anything to do with the item or the persistence. You have two axes (one x and one y) that are not currently in use and are configured to use a grid (gridIndex: 1) that doesn’t exist. Delete those extraneous axes (or, I suppose, add an additional grid) and it should work.

Amazing that worked, thanks @JustinG!