Topsurfer
(Martin)
December 12, 2020, 10:14am
1
Hi,
in the sitemap from BasicUI I “only” have this code and I can select between 4 time periods for the Grafana graph.
Switch item=Temperatures_Interval label="Verbrauchsintervall Auswahl" icon="line" mappings=[1="4 Stunden",2="1 Tag",3="2 Tage",4="Woche",5="Monat",6="Jahr"]
Webview icon=weather url="http://192.168.zz.x:3000/d-solo/bGjjjxxxRz/klima?panelId=8&from=now-4h&tab=legend&refresh=2s\" width=\"450\" height=\"300\" frameborder=\"0\"" height=14 visibility=[Temperatures_Interval == 1]
....
How can I realize a selection like this with Habpanel ?
I have no experience with manual created widgets (if this is needed), or is there a file like the sitemap-file to add code like this?
Has anyone an example or is there a widget I can use as “starting point” ?
Topsurfer
(Martin)
December 17, 2020, 1:20pm
2
Hi,
is there no chance to create this like in BasicUI?
Really hardcode every wanted time period and create link / pages to every graph (day, week, month, …) ?
mkhaled
(M.Khaled)
April 19, 2021, 11:44pm
4
Keep getting an error: invalid dimensions for plot, width=1028, height=0.
width value differs from 900-1028.
The plot only shows up when I refresh or click on the panel title → View
sitemap:
Frame label="Grafana selection chart" {
Switch item=Grafana_Dropdown label="Grafana Dropdown: " icon=chart mappings=[1="2 Hours", 2="4 Hours",3="6 Hours",4="8 Hours"]
Webview icon=line url="http://192.168.1.3:3000/d-solo/IM_GjMmRk/test-temp-and-humidity?orgId=1&panelId=2&from=now-2h&to=now&refresh=2s\" width=\"450\" height=\"300\" frameborder=\"0\"" height=10 visibility=[Grafana_Dropdown=="1"]
Webview icon=line url="http://192.168.1.3:3000/d-solo/IM_GjMmRk/test-temp-and-humidity?orgId=1&panelId=2&from=now-4h&to=now&refresh=2s\" width=\"450\" height=\"300\" frameborder=\"0\"" height=10 visibility=[Grafana_Dropdown=="2"]
Webview icon=line url="http://192.168.1.3:3000/d-solo/IM_GjMmRk/test-temp-and-humidity?orgId=1&panelId=2&from=now-6h&to=now&refresh=2s\" width=\"450\" height=\"300\" frameborder=\"0\"" height=10 visibility=[Grafana_Dropdown=="3"]
Webview icon=line url="http://192.168.1.3:3000/d-solo/IM_GjMmRk/test-temp-and-humidity?orgId=1&panelId=2&from=now-8h&to=now&refresh=2s\" width=\"450\" height=\"300\" frameborder=\"0\"" height=10 visibility=[Grafana_Dropdown=="4"]
}
Item:
//dummy virtual switch
String Grafana_Dropdown "Grafana Dropdown"
Please help! I have been stuck on this for hours.
rossko57
(Rossko57)
April 20, 2021, 12:33am
5
mkhaled:
refresh=2s\"
That quotemark doesn’t seem to have a partner.
Also seems a little odd to have some url parameters with & and some with space?
mkhaled
(M.Khaled)
April 20, 2021, 5:35am
6
Hi,
I was actually trying to follow Martin’s (original post) syntax, who stated he got this working
I just check my sitemap, and yes, the \ seems correct.
The end from the URL-part is NOT after: refresh=2s;
it ends at: frameborder=0 (there are two quote marks, one with \, one without !)
So the syntax is correct!
But where your “really” problem is, no idea. For me it works as provided. Sorry.
1 Like
rossko57
(Rossko57)
April 20, 2021, 11:09am
8
Yes I understand that. The alarm bells ring because quotes usually turn up in pairs, here we have an odd number of escaped quotes \"
mkhaled
(M.Khaled)
April 20, 2021, 4:10pm
9
What version of Grafana are you running?
Topsurfer
(Martin)
April 21, 2021, 10:27am
10
I think an older(er) Version,
7.3.5