Grafana Dashboards - Plotting XY Charts and Gantt Charts with JSON and multiple array data

  • What Grafana version and what operating system are you using?
    Grafana Version 9.4.7

  • What are you trying to achieve?
    I am using Elasticsearch as my Datasource. I want to plot XY chart and Gantt plots with below kind of Nested array data with JSON:

{“@timestamp”: “2023-08-16T08:38:38.105+05:30”, “id”: 1, “seconds”:[1,2,3,4,5], “a”:[0,1,1,0,1],“b”:[1,0,0,0,0],“c”:[0,1,1,0,1],“d”:[0,1,1,0,0],“e”:[0,1,1,0,0],“f”:[0,0,0,1,0]}
{“@timestamp”: “2023-09-16T08:38:38.105+05:30”, “id”: 2, “seconds”:[1,2,3,4,5], “a”:[0,1,1,0,1],“b”:[1,0,0,0,0],“c”:[0,1,1,0,1],“d”:[0,1,1,0,0],“e”:[0,1,1,0,0],“f”:[0,0,0,1,0]}

I have tried many transforms but unable to get desired result. I am unable to plot such data in Grafana. Is it possible to plot XY plots with such array fields?

I have already posted my query in detail in below topic:

Please, suggest some way to plot XY chart/ Gantt chart with such kind of array or nested array input.

Thanks in advance,
Priyanka Borgaonkar

@priyankaborgaonkar1 Apache ECharts allows you to plot XY with any transformation based on JavaScript:

1 Like

Thank you so much @mikhailvolkov. I will try this plugin.

1 Like

Thank you so much @mikhailvolkov for suggesting this plugin. I am able to plot XY charts from the array inputs of the Grafana Datasource. I can write my custom code using the inbuilt JavaScript Editor in this plugin. Happy with the results. I will explore this plugin further for other kind of plots. Thanks again!! :smiley:

1 Like

@priyankaborgaonkar1 Good to hear. Check out this and other ECharts videos for all the features

1 Like

Sure. I will go through these tutorials. It’s really helpful.

1 Like