How to generate clickable bigger graph pictures ?

425 views
Skip to first unread message

Stéphane Calonnec

unread,
Dec 14, 2016, 7:57:12 AM12/14/16
to weewx-user
Hello,
I am using WeeWX 3.6.2 with latest Interceptor driver on my Weathersleuth on my RPi 2 (everything works fine, except the wind gust dir never worked, the values are NULL), with the default skin (but heavily edited), and I'd like to click on a graph to enlarge it (to a new window for instance, no need of lightbox), but I don't know how to do this in WeeWX.

I found an interesting topic about adding some stansa to generate bigger pictures to a specific folder along the "regular" graphs (which is what I look for) but I do not know at all what stansa to add ; I also tried to give a look to some skins doing it but I could not find anything helpful to me. If I really can't, I'll trick using CSS.

May anyone give me some clues to generate bigger files in a specific folder ? :)

Thanks in advance !!!

Dave Webb KB1PVH

unread,
Dec 14, 2016, 8:22:21 AM12/14/16
to weewx...@googlegroups.com

In weewx.conf I have the following
 

[[StandardReport]]
        # See the customizing guide to change the units, plot types and line
        # colors, modify the fonts, display additional sensor data, and other
        # customizations. Many of those changes can be made here by overriding
        # parameters, or by modifying templates within the skin itself.

        # The StandardReport uses the 'Standard' skin, which contains the
        # images, templates and plots for the report.
        skin = Standard
        [[[Units]]]
            [[[[Groups]]]]
                group_pressure = mbar
    [[BigReport]]
        skin = Standard
        HTML_ROOT = public_html/big
        [[[ImageGenerator]]]
            image_width = 619
            image_height = 413




Then in index.html.tmpl I have the following

                <td class="data">$almanac.moon_phase<br/>($almanac.moon_fullness% full)</td>
              </tr>
            </table>
            #end if
          </div> <!-- end class "celestial_group" -->
        </div> <!-- end id "almanac" -->

        <div id="plots">
<a href="big/daytempdew.png">            <img src="daytempdew.png"   alt="temperatures" /></a>
<a href="big/daytempchill.png">          <img src="daytempchill.png" alt="heatchill" /></a>
<a href="big/dayrain.png">               <img src="dayrain.png"      alt="rain" /></a>
<a href="big/daywind.png">               <img src="daywind.png"      alt="wind" /></a>
<a href="big/daybarometer.png">          <img src="daybarometer.png" alt="barometer"/></a>
<a href="big/daywinddir.png">            <img src="daywinddir.png"   alt="Hi Wind" /></a>
<a href="big/dayinside.png">             <img src="dayinside.png"    alt="Inside" /></a>
<a href="big/daywindvec.png">            <img src="daywindvec.png"   alt="Wind Vector" /></a>
          #if $day.radiation.has_data
          <img src="dayradiation.png" alt="Radiation" />
          #end if
          #if $day.rxCheckPercent.has_data
<a href="big/dayrx.png">                 <img src="dayrx.png"        alt="day rx percent"/></a>
          #end if
          #if $day.extraTemp1.has_data
          <img src="daypond.png"      alt="Pond Temperatures" />


It can be viewed here qsl.net/kb1pvh/weather


Dave-KB1PVH


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stéphane Calonnec

unread,
Dec 14, 2016, 8:25:28 AM12/14/16
to weewx-user
I think this is EXACTLY what I wanted, thanks very much !!!! It looks so easy, but I really didn't know how to do...I'll test but I'm sure it will work :)
Thank you again ++++++++++++++++

Stéphane Calonnec

unread,
Dec 14, 2016, 11:18:06 AM12/14/16
to weewx-user
I just tested your code, it works perfectly, thank you again, this is something I was trying to do since a long time !!

Dave Webb KB1PVH

unread,
Dec 14, 2016, 11:20:11 AM12/14/16
to weewx...@googlegroups.com
Glad it worked for you. 

Dave-KB1PVH


Sent from my Galaxy S7

On Dec 14, 2016 11:18 AM, "Stéphane Calonnec" <daniel....@gmail.com> wrote:
I just tested your code, it works perfectly, thank you again, this is something I was trying to do since a long time !!

--

Chris Mattingly

unread,
Dec 14, 2016, 3:49:17 PM12/14/16
to weewx-user
Dave, was there any particular reason for placing these in weewx.conf (which causes the full report to run twice) versus modifying skin.conf?

I simply added stanzas such as:
        [[[bigdaybarometer]]]

            image_width = 619
            image_height = 413
            [[[[barometer]]]]

Into the skin.conf, and then made similar edits to index.html.tmpl as you did below.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Dave Webb KB1PVH

unread,
Dec 14, 2016, 3:56:57 PM12/14/16
to weewx...@googlegroups.com
Chris,

To be honest, I'm not sure why I did it that way, LOL. I'm far from a programming ninja. 


Dave-KB1PVH


Sent from my Galaxy S7
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Dave Webb KB1PVH

unread,
Dec 14, 2016, 5:28:44 PM12/14/16
to weewx...@googlegroups.com
Chris,

 I got thinking about your comment and I believe when I first started the Big plots it was weewx 2.7.x and you could just enable Big reports and I adjusted the size.  The newer versions of weewx implement it differently, I think. 

Dave-KB1PVH


Sent from my Galaxy S7

Chris Mattingly

unread,
Dec 14, 2016, 5:43:26 PM12/14/16
to weewx...@googlegroups.com
Seems to be the case. When I saw that this method was creating the entire report twice I figured there had to be another way. :)

Dave Webb KB1PVH

unread,
Dec 14, 2016, 5:44:15 PM12/14/16
to weewx...@googlegroups.com
It only seems to create it one time here according to the log. 


Dave-KB1PVH


Sent from my Galaxy S7

Thomas Keffer

unread,
Dec 14, 2016, 5:51:39 PM12/14/16
to weewx-user
​Skin configuration, including overrides from weewx.conf, have not changed since they were introduced in V1.7.0, now 6+ years ago.​

-tk

Chris Mattingly

unread,
Dec 14, 2016, 7:13:59 PM12/14/16
to weewx...@googlegroups.com
Interesting. At any rate, I'll stick with the additional image generation inside the skin to save that tiny bit of CPU and disk space. ;)



Stéphane Calonnec

unread,
Dec 19, 2016, 8:14:53 AM12/19/16
to weewx-user
Very interesting posts :)
It's indeed creating a whole new report into the big folder.
I don't understand the syntax [[[bigdaybarometer]]], does it generate a file bigdaybarometer.png into the root folder ?
I deleted (commented) the weewx.conf edit to test the [[[bigdaybarometer]]] addition to skin.conf,but I don't know where the file drop. Also, my barometer graph is now empty (I have grid and time, but no graph and no title), I think I put the stanza on the wrong place. Here is my latest syslog (after 2 init.d reload and stop/start of course):

Dec 19 14:10:06 raspsc weewx[15359]: cheetahgenerator: Generated 14 files for report StandardReport in 7.22 seconds
Dec 19 14:10:07 raspsc weewx[15359]: genimages: Generated 13 images for StandardReport in 1.71 seconds
Dec 19 14:10:07 raspsc weewx[15359]: reportengine: copied 9 files to /var/www/weewx
Dec 19 14:10:11 raspsc weewx[15359]: cheetahgenerator: Generated 14 files for report BigReport in 3.14 seconds
Dec 19 14:10:12 raspsc weewx[15359]: genimages: Generated 13 images for BigReport in 1.69 seconds
Dec 19 14:10:12 raspsc weewx[15359]: reportengine: copied 9 files to /var/www/weewx

Python is so new to me... :p
I'll look for that later :)

Stéphane Calonnec

unread,
Dec 19, 2016, 11:57:10 AM12/19/16
to weewx-user
Back ! The picture is now generated, and i put the stanza in the wrong place, so it could not work properly. Now everything looks to work fine, and I understand now how syntax works... :)
Thanks for everything, I think this will be easier to manage for my Raspberry !!

I'll try to add a vertical line to midnight in day pictures (to show separate days) and change some colors (but I'm used to HEX formatted colors, like #000000 but when I add the "#" it crashes as it takes it as a comment lol).
Reply all
Reply to author
Forward
0 new messages