Visualise an array as a matrix

Hello Grafana community!

What Grafana version and what operating system are you using?

Version 9.5.3 - RaspberryOS

What are you trying to achieve?

I read the data from a sensor and make it available in Grafana via the JSON interface. Thereby 36 values are read out in one pass and stored in an array.

  • I would like to display these values in a 6x6 matrix
  • The matrix should be updated every 1 second

How are you trying to achieve it?

So far I have looked at

  • visualization “table” with transform “group to matrix”,
  • visualization “heatmap”
  • visualization “esnet matrix panel”

What did you expect to happen?

However, so far I have not been able to customize the various visualizations to display a 6x6 matrix. Furthermore no time values should be displayed.

Did anyone try something similar and could help me please? Thank you very much!

Please post sample of your json data

Sure:

[{
	"sensor": "Sensor1",
	"values": [1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1]
}, {
	"sensor": "Sensor2",
	"values": [0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1]
}]

and in the end it should look like this:

the problems I have with this solution is:

  • I can’t set it to auto update every 1s, only every 5s
    • if I change the setting in the dashboard and enter “1s” as an option I can’t save the dashboard
  • the values are actually in a row and the line break after 6 values happens because of the layout and not because it is a matrix
    • that could be a problem with different screen sizes

Ok, I solved that one with this solution already:

1 Like