Using queried data in Plotly plugin

Hello,
I’m currently attempting to migrate what currently exists as a bar chart using Plotly in Windmill.dev
I have a python script that sets up the plotly data and layout, then feeds it into the plotly panel object.

My desire was to replicate this panel over in Grafana Cloud (for scheduled reporting purposes) along with some of our other panels, however I can not seem to find any sort of documentation on how to use queried data in order to set up my plotly panel in Grafana (using the nLine plugin).

Does anyone know how to accomplish this or maybe have a link to documentation where I can read up on this? I can manipulate the script to change up what gets returned if necessary, but just need to figure out how I could dynamically create/adjust this chart on the Grafana end.

check this out

Also can you please specify what datasource you are using and if you can provide some sample data, we will try to guide you

This looks like it’s specific to the Business Text plugin, but I was looking moreso at this one: Plotly plugin for Grafana | Grafana Labs
Is there much of a difference?

Also for my datasource, it’s an infinity datasource querying the endpoint for my script in Windmill cloud, which is pulling a table that contains two objects: data and layout, which are just json objects for each, respectively.

gotcha, other than the github documentation I am not seeing real world examples

but here is something that can get you going

1 Like

Awesome, it looks like I’ve managed to get it to “accept” the data - though for some reason it looks like it’s defaulting to have date as the x-axis (and defaulting to January 2000), where I’d rather have my x-values as my x-axis, which is odd because this is defined in my data and layout (and I’m able to see those values are still present in my console log).

Wonder if that’s just not something I can override in my query response or if the naming convention is different

EDIT: Looks like literally all it needed was for me to replace everything in the Layout Editor with the word “layout”. So we’re in business! Thanks for the help!

1 Like

@calvinnisson where did you find that gem :gem_stone:

1 Like

Was trying to get it to stop re-populating with that default layout, if i just deleted everything it would come back and if I changed any of the defaults, nothing visually changed.
So I just figured I’d replace it with something that gets rid of the entire set up and that happened to work :sweat_smile:

1 Like