# Best way to show Grafana in Dashboard?

**URL:** <https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667>\
**Category:** Dashboard\
**Created:** [18 September 2019 16:53 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667 "2019-09-18T16:53:36Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 15:10 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/22 "2019-10-18T15:10:24Z")

</div>

yes i do that . But if i has a security problem , i could not see the Grafana curves in Chrome by paste the http adress. right ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fea18ea988d5426a43af202db9524a85cd4d54d0.png)

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 15:11 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/23 "2019-10-18T15:11:51Z")

</div>

@Colin yes this is the code in Template node

> [@SuperNinja](#):
>
> That's the finaly code :
> 
> ```auto
> panelid=2
> msg.template= "<iframe "+
> "style=\"width:600px; height:300px; overflow:hidden; margin:auto; border:0px solid green;\" "+ 
> 
> "src=http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1"+
> "&amp;refresh=1m"+
> "&amp;theme=dark"+
> "&amp;from="+ msg.fromdate +
> "&amp;to="+ msg.enddate +
> "&amp;panelId="+panelid+"> </iframe>"
> 
> return msg;
> 
> ```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 October 2019 15:13 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/24 "2019-10-18T15:13:33Z")

</div>

> [@SuperNinja](#):
>
> ```auto
> "src=http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1"+ 
> "&amp;refresh=1m"+
> "&amp;theme=dark"+ 
> "&amp;from="+ msg.fromdate +
> "&amp;to="+ msg.enddate +
> "&amp;panelId="+panelid+"> </iframe>"
> 
> ```

You need to change the `&amp;` to `&` so the code is

```auto
"src=http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1"+ 
"&refresh=1m"+
"&theme=dark"+ 
"&from="+ msg.fromdate +
"&to="+ msg.enddate +
"&panelId="+panelid+"> </iframe>"

```

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 15:16 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/25 "2019-10-18T15:16:51Z")

</div>

@zenofmud :  
the same ☹

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cd8f5c3bbe5d3479fcf4c59d94d96267454488e5.png)

Someone else 🤣

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2019 15:18 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/26 "2019-10-18T15:18:14Z")

</div>

> [@zenofmud](#):
>
> "src=[http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1](http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1)"+

Doesn't that need to be  
`"src=/"http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1/""+`  
to get the extra quotes round the URL?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2019 15:27 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/27 "2019-10-18T15:27:29Z")

</div>

> [@SuperNinja](#):
>
> But if i has a security problem , i could not see the Grafana curves in Chrome

Also make sure you are not logged into grafana in the browser when you test it like that. Remember you will not be logged into grafana in the iframe.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 October 2019 15:29 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/28 "2019-10-18T15:29:03Z")

</div>

@Colin I do beleive you are right, I was just looking at the &amps;

@SuperNinja put a debug node (display complete msg) on the `Build Template` and see what is actually being built.  
show us what you get.

you also need a closing `\"` at the end of the `src=` statement  
"&panelId="+panelid+"`\"`\> "

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2019 16:07 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/29 "2019-10-18T16:07:44Z")

</div>

Plus I had put one in at the end of the first line, so to summarise it should be, I think

```auto
"src=\"http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1"+ 
"&refresh=1m"+
"&theme=dark"+ 
"&from="+ msg.fromdate +
"&to="+ msg.enddate +
"&panelId="+panelid+\""> </iframe>"

```

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 16:31 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/30 "2019-10-18T16:31:10Z")

</div>

ther is something wrong :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/294fdc5436d88b8e8bbd5f3ef5dd403d863553df.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2019 16:51 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/31 "2019-10-18T16:51:47Z")

</div>

Surely you can work that out.

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 16:54 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/32 "2019-10-18T16:54:30Z")

</div>

> [@zenofmud](#):
>
> put a debug node

**with this code in TEmplate Node:**

```auto
panelid=2
msg.template= "<iframe "+
"style=\"width:600px; height:300px; overflow:hidden; margin:auto; border:0px solid green;\" "+ 

"src=http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1"+ 
"&refresh=1m"+
"&theme=dark"+
"&from="+ msg.fromdate +
"&to="+ msg.enddate +
"&panelId="+panelid+"> </iframe>"

return msg;

```

**i got this DEBUG :**

```auto
msg : Object
object
payload: 24
socketid: "ThfNmwf-XPiEqAj6AAAY"
_msgid: "ed4f735b.2837d"
fromdate: "now-24h"
enddate: "now"
template: "<iframe style="width:600px; height:300px; overflow:hidden; margin:auto; border:0px solid green;" src=http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1&refresh=1m&theme=dark&from=now-24h&to=now&panelId=2> </iframe>"

```

**If i copy the adress generated :**

```auto
http://localhost:3000/d-solo/GQ47zhIZk/chri-dashboard?orgId=1&refresh=1m&theme=dark&from=now-24h&to=now&panelId=2

```

**And past in Chrome (with Grafana CLOSED) , i got this working graph :**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/215a976bdd8f392b548589fd31f5f800dabbc4c8.png)  
**But this non working Dashboard :**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/dd1f0d20fda23a2763293b50afeeabcefabd0bfc.png)  
🤔

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2019 17:34 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/33 "2019-10-18T17:34:10Z")

</div>

You still haven't got the quotes round the url, it needs to be `src="http:.."`

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [18 October 2019 17:48 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/34 "2019-10-18T17:48:16Z")

</div>

The security warning is because you did not edit the grafana.ini correct.  
URL should be as in the example flow, no need for extra @#£\*&())+.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 October 2019 17:58 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/35 "2019-10-18T17:58:19Z")

</div>

It is much simpler if you use single quotes for the JavaScript strings, then you don't have to worry about escaping the double quotes for html.

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 18:31 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/36 "2019-10-18T18:31:12Z")

</div>

in your opinion, if i has a security problem , i could not see the Grafana curves in Chrome by paste the http adress ? right or wrong?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/763a007a6d92b22c5527d7b501ef5b8070e9f196.png)

**To complete the search:**

- Node Red runs on Win10 (Node Red Desktop by Sakazuki)
- Grafana is also installed on Win10 (through InfluxdB on win10 too)
- I do not have a Grafana.ini (i search everywhere) but Custom.ini in which I found and modified the **anonymous access enabled = true** and **allow\_embedding = true**

You know everything

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [18 October 2019 19:20 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/37 "2019-10-18T19:20:29Z")

</div>

To verify grafana.ini (or custom.ini in win10) settings go in Grafana dashboard to (left side) **server admin** -\> **settings**  
Search for the section **auth.anonymous** and check the **enabled** is **true**.  
Goto the **security** section and verify that the **allow\_embedding** is also **true**.

Tested with Grafana 6.3.2

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 19:54 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/38 "2019-10-18T19:54:12Z")

</div>

**in custom.ini**  
security :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/99a88410e109c5ced3b86f10d2ecceea4e90b0c8.png)  
anonymous:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7b128c955452f3cc36461bb1a41951ec4a3ac981.png)

i don't understand why, in Grafana they are False !?  
**in grafana server admin-\> settings :**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fe3ae5fcdcc3917caa0ba76d049dd7fe670a6ffc.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/938a90e40e899133a0e846440cc37a0d7f54e13d.png)

How to restart Grafana ? I restart the win10 PC : Is that enough?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 October 2019 20:13 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/39 "2019-10-18T20:13:48Z")

</div>

Just to confirm ... you are running the Grafana service on a Windows 10 PC?

How are you starting it?

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [18 October 2019 20:39 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/40 "2019-10-18T20:39:09Z")

</div>

good question !  
After download and install the last Grafana Win10 package, i connecting to **[http://localhost:3000/](http://localhost:3000/)** and create new Grafana dashboard.  
[https://grafana.com/docs/installation/windows/](https://grafana.com/docs/installation/windows/)

---

<div class="post-metadata">

**Author:** ![bilalmahmad](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bilalmahmad](https://discourse.nodered.org/u/bilalmahmad)\
**Post date:** [19 April 2020 18:56 UTC](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667/41 "2020-04-19T18:56:02Z")

</div>

Hello msmthng,  
Did you manage to find any solution to this.

[Previous page](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667.md?page=1)

[Next page](https://discourse.nodered.org/t/best-way-to-show-grafana-in-dashboard/15667.md?page=3)
