Working with slabel

Discussion about generation of graphs and tables
Post Reply
lubuwetter
Posts: 16
Joined: Thu Jan 02, 2014 10:16 pm

Working with slabel

Post by lubuwetter » Thu Mar 20, 2014 7:36 am

Hi everybody,

can someone explain to me how to work with slabel.
In the wiki I found the following

Code: Select all

Defines label to be displayed on top of each data item in the chart. Label can contain "value" for current data value or in min/max charts "low" and "high" for min resp. max values. 
I have the following chart

Code: Select all

timeframe=4M    # set total time frame to 3 days before today until today
zoom=MAX          # select actual day 
res=day1           # get data per day
monlist=Jan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez 
daylist=Mon,Die,Mit,Don,Fre,Sam,Son

gtitle=Niederschlag        # name of graph
gheight=450       # height in pixels of graph
gwidth=700         # width in pixels of graph
glunit=mm            # unit of left y-axis
grunit=mm/h
gtype=bar          # type of graph
gtrim=0              

sid1=rain* scolor1=AADDFF  slabel1=mm sfill1=50 sline1=100 sname1=Niederschlagsmenge ssel1=total    # sensor 0, rainfall
sid0=rain* syaxis0=r stype0=line ssmooth0=1 sname0=Max._Niederschlagsrate sunit0=mm/h ssel0=ratemax sconnect0=1
It's a bar chart with the rain bars.
But I can't find a label in the graph. I supposed to have a label with the rain value on top of each bar.
What is wrong or am I understanding sth wrong?
Does somebody have an example?

Thx in advance

regards

Michael

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: Working with slabel

Post by admin » Sat Apr 05, 2014 1:01 pm

wrong format: "sid0" line has to be positioned before "sid1"

lubuwetter
Posts: 16
Joined: Thu Jan 02, 2014 10:16 pm

Re: Working with slabel

Post by lubuwetter » Sat Apr 12, 2014 8:38 pm

Thx for your answer.
The order seems not to be the problem.
I've changed the order but nothing happens.
In addition I tried slabel in a bar graph with only one graph. Again it doesn't work.

Code: Select all

timeframe=1Y    # set total time frame to 3 days before today until today
zoom=MAX            # select actual day 
res=month1           # get data per day

gtitle=Niederschlag_pro_Monat        # name of graph
gheight=400       # height in pixels of graph
gwidth=825         # width in pixels of graph
glunit=mm            # unit of left y-axis
glmin=0
gtype=gpbar          # type of graph
#ggpformat=set_locale_"de__DE"
ggpformat=set_format_x_"%b";set_locale_"de__DE"
gtrim=1              

sid0=rain0 scolor0=0000AE  slabel0=mm sfill0=100 sline0=100 sname0=Niederschlag ssel0=total    # sensor 0, rainfall
Any other hints

regards

Michael

User avatar
admin
Site Admin
Posts: 332
Joined: Sun Feb 07, 2010 9:22 pm

Re: Working with slabel

Post by admin » Fri Apr 18, 2014 10:00 am

I checked this feature not touched for months and there are two things to mention:
1) it just works with Javascript Charts, so there needs to be a definition "engine=js" somewhere in the beginning
2) it does annotate every single data item in the chart. Not sure if you intend to do this. When you just want to add a unit to the numbers already displayed, go for "sunit" etc.

Example:

Code: Select all

timeframe=3D    # set total time frame to 3 days before today until today
zoom=MAX      # select actual day 
res=min10           # get data per 10 minutes
engine=js

gtitle0=Temperature
gheight0=150 gwidth0=700 glunit0=°C gtype0=line              
sid0_0=th* ssmooth0_0=1 sname0_0=Temp scolor0_0=880000 sfill0_0=10 ssel0_0=temp slabel0_0=[[value]]°C
sid0_1=th* ssmooth0_1=1 sname0_1=Temp_Max scolor0_1=FF0000 sline0_1=40 ssel0_1=tempmax
sid0_2=th* ssmooth0_2=1 sname0_2=Temp_Min  scolor0_2=8800FF sline0_2=40 ssel0_2=tempmin
results into:
Attachments
Screen Shot 2014-04-18 at 11.56.19.png
Screen Shot 2014-04-18 at 11.56.19.png (19.22 KiB) Viewed 7817 times

lubuwetter
Posts: 16
Joined: Thu Jan 02, 2014 10:16 pm

Re: Working with slabel

Post by lubuwetter » Sun Apr 20, 2014 6:28 pm

That's it.
Thank you very much.

regards

Michael

Post Reply