# Using queried data in Plotly plugin

**URL:** <https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278>\
**Category:** Grafana\
**Tags:** plugins\
**Created:** [March 27, 2025, 1:48pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278 "2025-03-27T13:48:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![calvinnisson](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@calvinnisson](https://community.grafana.com/u/calvinnisson)\
**Post date:** [March 27, 2025, 1:48pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/1 "2025-03-27T13:48:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 27, 2025, 1:54pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/2 "2025-03-27T13:54:28Z")

</div>

check this out

> **[Plotly | Volkov Labs](https://volkovlabs.io/plugins/business-text/external/plotly/)**
>
> Thanks to our community member Josiah Solomon for the provided solution.

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

---

<div class="post-metadata">

**Author:** ![calvinnisson](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@calvinnisson](https://community.grafana.com/u/calvinnisson)\
**Post date:** [March 27, 2025, 1:58pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/3 "2025-03-27T13:58:52Z")

</div>

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](https://grafana.com/grafana/plugins/nline-plotlyjs-panel/)  
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.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 27, 2025, 2:11pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/4 "2025-03-27T14:11:49Z")

</div>

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

> **[GitHub - nline/nline-plotlyjs-panel: Plotly.js for Grafana](https://github.com/nline/nline-plotlyjs-panel?tab=readme-ov-file)**
>
> Plotly.js for Grafana

but here is something that can get you going

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/8/c/8c4289f8391e48c013b81244f5370d7545dc8966.png)

---

<div class="post-metadata">

**Author:** ![calvinnisson](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@calvinnisson](https://community.grafana.com/u/calvinnisson)\
**Post date:** [March 27, 2025, 3:41pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/5 "2025-03-27T15:41:21Z")

</div>

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).

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/2/6/2644b63e3ee8c55c898edf743ee2ea51abce5d10.png)

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!

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 27, 2025, 3:54pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/6 "2025-03-27T15:54:26Z")

</div>

@calvinnisson where did you find that gem 💎

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/f/0f54f6faa03262f3aa3deff637f815418dd06e62.png)

---

<div class="post-metadata">

**Author:** ![calvinnisson](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@calvinnisson](https://community.grafana.com/u/calvinnisson)\
**Post date:** [March 27, 2025, 5:41pm UTC](https://community.grafana.com/t/using-queried-data-in-plotly-plugin/147278/7 "2025-03-27T17:41:56Z")

</div>

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 😅
