How to display charts in sitemaps?

Hi,

I’m struggling to display a chart in my sitemap.

I have persistence services set up, so this url gives me a pretty chart of three items:

http://localhost:8080/chart?items=OutsideTemp,Temp1,Temp2i&period=W

But if I display it with

Image url="http://localhost:8080/chart?items=OutsideTemp,Temp1,Temp2i&period=W"

or

Webview url="http://localhost:8080/chart?items=OutsideTemp,Temp1,Temp2i&period=W"

I just get a blank space in the UI.

What am I missing?

thank you!

hi,

i use a “Chart” item with rrd4j
you need the org.openhab.persistence.rrd4j addon bundle

then in my sitemap i have:

Chart item=gaszaehler_statistik period=D refresh=30000

in my items file:

Group gaszaehler_statistik                                          (Gas)
Number gaszaehlerstand        "Zaehlerstand [%d]"        (gaszaehler_statistik)

and in the persistence folder a rrd4j.persist to which i added:

Items {
* : strategy = everyChange, everyDay, restoreOnStartup  
Gas* : strategy = everyHour
gaszaehler_statistik* : strategy = everyMinute
}

here it’s explained in more detail:

Unless I’m mistaken, chart items are limited to displaying one dataset - I wanted to display several on the same chart (which my url does).

Hi Dan,
you can display more items in one chart.
just define a group and assign this group to all off your items you want in your chart.

so your item-file would look something like this:

Group TempChart

Number OutsideTemp "Outside Temperature" (TempChart) ....
Number Temp1 "Room 1 Temperature" (TempChart) ...
Number Temp 2 "Room 2 Temperature" (TempChart) ...

your sitemap would then look like this:

Chart item=TempChart period=D refresh=30000

it this what you are looking for?

2 Likes

that is exactly what I was looking for - thank you!

Dan