Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.3 build 3059 - 04 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    Highcharts Graphs

    Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
    uncle_bob
    Posts: 493
    Joined: Wed 17 Aug 2011 2:58 pm
    Weather Station: WeatherDuino Pro2
    Operating System: 2008
    Location: Canberra

    Re: Highcharts Graphs

    Post by uncle_bob » Tue 08 May 2018 9:48 am

    Good morning all (trying to sound like Julian Ilett :) )

    Yes, vers 2.8 seemed to have worked fine:

    08/05/18 - 11:45:20
    Importing to table: Dayfile ...
    Processing dayfile: C:\Cumulus\data\dayfile.txt
    Table does not exist, creating it...
    Inserting data...
    Inserted 2446 rows
    done.
    End of script 08/05/18 - 11:45:23 - execution time: 2.864s
    Interested in building your own Weather Station? Maybe check out the WeatherDuino Pro Project Here
    Conder, Canberra Weather
    Image

    User avatar
    mcrossley
    Posts: 5801
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Highcharts Graphs

    Post by mcrossley » Tue 08 May 2018 9:54 am

    OK, good to know, I think the binding error is to do with you having "null" values in the data file - In mine I have set all those to zero values at some point. I didn't get a chance to look at this yesterday, but at some point I'll see if that is the problem and what I can do about it...

    uncle_bob
    Posts: 493
    Joined: Wed 17 Aug 2011 2:58 pm
    Weather Station: WeatherDuino Pro2
    Operating System: 2008
    Location: Canberra

    Re: Highcharts Graphs

    Post by uncle_bob » Tue 08 May 2018 10:58 am

    Hi Mark, and thanks for the help with this.
    There will definitely be issues since I had to try and Un-Fine Offset the corrupted data when I've noticed it.
    If you want to have a play around with my complete dayfile, let me know.
    Thanks again UB :)
    Interested in building your own Weather Station? Maybe check out the WeatherDuino Pro Project Here
    Conder, Canberra Weather
    Image

    sfws
    Posts: 466
    Joined: Fri 27 Jul 2012 11:29 am
    Weather Station: Final post in top ten topic
    Operating System: Tempermental Win. 10 PC
    Location: Moving

    Re: Highcharts Graphs

    Post by sfws » Tue 08 May 2018 1:42 pm

    mcrossley wrote:having "null" values in the data file - In mine I have set all those to zero values
    Maybe, it is just personal preference, as I'm not a computer specialist, but "garbage in, garbage out" is a saying that I have heard. I don't want to apply validation in each retrieval script, I prefer to apply it once when loading the database (and therefore I use nulls extensively). The use of zero values does not make sense to me, zero is definitely a valid number in many measurements.

    Back in 2014 when I made my first exploratory venture into PHP and database, I rejected using your script (earlier version) and wrote my own because I wanted to use official nulls for any values where either the measurement was missing or it was suspect. Ironically it was some rogue temperature measurements that influenced my thinking, so using zero would definitely not suit me. Incidentally, in my script I also set time-stamps to null when the associated value does not "make sense" (unlike Cumulus that would leave those time-stamps at rollover time). So if there is no rain in a day, the time of the highest hourly rain (or time of peak rain rate) is to my way of thinking null rather than rollover time just as much as it would be if the rain gauge was not working. Of course, my database tables are not exact mirrors of any Cumulus log files, so I don't think your binding approach would work with my tables, and because I access real-time log directly on the rare times I need it, speed of loading database tables does not matter to me.

    User avatar
    mcrossley
    Posts: 5801
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Highcharts Graphs

    Post by mcrossley » Tue 08 May 2018 2:11 pm

    It's been debated before, if I were starting from scratch I'd possibly use a different DB schema, however the script and DB was in existence for a year or so before I started using it. David Jamieson originally constructed it and decided to make the DB a more or less straight copy of the Cumulus log files, which was as valid decision as any at the time.

    I'm sure if Steve were starting from scratch he'd probably alter the Cumulus log file format too, but we have what we have.

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Thu 27 Jun 2019 10:06 pm

    Not sure if there's another more relevant thread, but have browsed right thru this one & see a few mentions of what I want, but no resolution.

    I decided I'd like my graphs to span 7 days instead of my previous 48 hours, so changed Graph hours to 168 hours.
    Then decided I wanted more Zoom buttons, so addressed that in cumuluscharts.js.
    EDIT (I am using MX, but couldn't see a Highcharts Subforum).

    THEN, decided I preferred the 48 hour time span as a default.

    Setting a range is mentioned in this post, but the answer is outside the thread.
    viewtopic.php?f=18&t=8672&start=315#p126119

    How do I get the chart to default to 48 hours & not lose the zoom buttons.
    TempGraph.JPG

    Code: Select all

            rangeSelector: {
                buttons: [{
                        count: 6,
                        type: 'hour',
                        text: '6h'
                    }, {
                        count: 12,
                        type: 'hour',
                        text: '12h'
                    }, {
                        count: 24,
                        type: 'hour',
                        text: '24h'
                    }, {
                        count: 48,
                        type: 'hour',
                        text: '48h'
                    }, {
                        count: 72,
                        type: 'hour',
                        text: '3d'
                    }, {
                        count: 96,
                        type: 'hour',
                        text: '4d'
                    }, {
                        count: 120,
                        type: 'hour',
                        text: '5d'
                    }, {
                        type: 'all',
                        text: 'All'
                    }],
                inputEnabled: false
            }
    
    You do not have the required permissions to view the files attached to this post.
    Image

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Thu 27 Jun 2019 10:40 pm

    Found other references, and can now get it to default to 48 hours, but as mentioned the buttons are not visible until the zoom slider is moved.

    Viewers may not realise this & be unaware that zoom is available.

    Code: Select all

            rangeSelector: {
                selected: 3,
                buttons: [{
                        count: 6,
                        type: 'hour',
                        text: '6h'
                    }, {
                        count: 12,
                        type: 'hour',
                        text: '12h'
                    }, {
                        count: 24,
                        type: 'hour',
                        text: '24h'
                    }, {
                        count: 48,
                        type: 'hour',
                        text: '48h'
                    }, {
    
    Edit,
    Logic is telling me that rather than selecting a range, I need a line to activate a button once they are drawn,
    but I have very little java knowledge.
    Image

    User avatar
    beteljuice
    Posts: 2790
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Highcharts Graphs

    Post by beteljuice » Thu 27 Jun 2019 11:10 pm

    Instead of:

    Code: Select all

    inputEnabled: false
    Try

    Code: Select all

    enabled: true
    https://jsfiddle.net/gh/get/library/pur ... r/enabled/

    or

    Code: Select all

    allButtonsEnabled: true
    https://jsfiddle.net/gh/get/library/pur ... bled-true/
    Image
    ......................Imagine, what you will KNOW tomorrow !

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Fri 28 Jun 2019 10:03 am

    Just tried that, and the display I get is this.
    TempGraph2.JPG
    What I'm trying to achieve when I visit the page is this, just the last 48 hours by default.
    TempGraph.JPG

    Code: Select all

            rangeSelector: {
              selected: 3,
                buttons: [{
                        count: 6,
                        type: 'hour',
                        text: '6h'
                    }, {
                        count: 12,
                        type: 'hour',
                        text: '12h'
                    }, {
                        count: 24,
                        type: 'hour',
                        text: '24h'
                    }, {
                        count: 48,
                        type: 'hour',
                        text: '48h'
                    }, {
                        count: 72,
                        type: 'hour',
                        text: '3d'
                    }, {
                        count: 96,
                        type: 'hour',
                        text: '4d'
                    }, {
                        count: 120,
                        type: 'hour',
                        text: '5d'
                    }, {
                        type: 'all',
                        text: 'All'
                    }],
                enabled: true
            }
    [/[code]
    You do not have the required permissions to view the files attached to this post.
    Image

    User avatar
    beteljuice
    Posts: 2790
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Highcharts Graphs

    Post by beteljuice » Fri 28 Jun 2019 11:36 pm

    Did you try the second option ?

    allButtonsEnabled: true

    The js fiddle looks very similar to what you want to do (show buttons and preselect option)
    Image
    ......................Imagine, what you will KNOW tomorrow !

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Sat 29 Jun 2019 9:21 pm

    Yes,

    Tried the above in 3 places, before & after the selected=3 & at the end of the section.
    2nd two positions stopped the graph displaying.
    1st resulted in a full 7 day graph not the 48 hours.
    Image

    User avatar
    beteljuice
    Posts: 2790
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Highcharts Graphs

    Post by beteljuice » Sat 29 Jun 2019 11:21 pm

    That sounds like a syntax error - missing comma / semi-colon / colon - whatever
    Image
    ......................Imagine, what you will KNOW tomorrow !

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Sun 30 Jun 2019 8:16 pm

    I see an example working exactly like I want here, https://weather.wilmslowastro.com/graphs_recent.php on @mcrossley s site.
    Image

    User avatar
    beteljuice
    Posts: 2790
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Highcharts Graphs

    Post by beteljuice » Sun 30 Jun 2019 10:00 pm

    Apologies to Mark ....

    Marks is part of a common graphs 'theme'

    The part of the code you say you want is:

    Code: Select all

        rangeSelector: {
            buttons: [{
                count: 6,
                type : 'hour',
                text : '6h'
            }, {
                count: 12,
                type : 'hour',
                text : '12h'
            }, {
                count: 1,
                type : 'day',
                text : '1d'
            }, {
                count: 2,
                type : 'day',
                text : '2d'
            }],
            buttonTheme : {'stroke-width': 1},
            inputEnabled: false,
            selected    : 1
        }
    So back to original inputEnabled: false - the only obvious thing I can see is the location of the selected option ?
    Image
    ......................Imagine, what you will KNOW tomorrow !

    Phil23
    Posts: 344
    Joined: Sat 16 Jul 2016 11:59 pm
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Win7 Pro
    Location: Australia

    Re: Highcharts Graphs

    Post by Phil23 » Mon 01 Jul 2019 10:45 am

    Crashed & burnt with this today.....

    Wasn't the right time for changes.

    Was the above a cut from Mark's code?

    Got the impression that the commented out "Try It" lines I had messed with things, but that shouldn't really be the case??
    Image

    Post Reply