Ad Widget

Collapse

Change time range on graphs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n8wood
    Junior Member
    • Nov 2004
    • 9

    #1

    Change time range on graphs

    Hi, is there any way to change the range of time from 1 hour to something larger on the custom graphs?

    Thanks!
  • joe
    Junior Member
    • Nov 2004
    • 27

    #2
    Time Range Defaults to something besides 1 hr?

    I am wondering about this same thing. The graphs all default to 1hr, and can be changed manually when you are viewing the graph.

    I want to default the graphs to something else (say 24 hours). This setting also impacts the screens. IMO, 1 hour graphs don't mean too much to me (network admin), and currently there doesn't seem to be a way to change what the screens show.

    Anyone know how to change this behavior?

    Thanks!

    joe

    Comment

    • mucknet
      Member
      • Dec 2004
      • 59

      #3
      I agree that the screens page is almost useless without the ability to do a mass change to all the graphs on the screen at once.

      Is this planned for 1.1?

      Comment

      • joe
        Junior Member
        • Nov 2004
        • 27

        #4
        The bigger issue is that this information isn't stored in the database, so it's the PHP frontends job to determine the range.

        However, maybe it would make sense to create another field in the graphs table to store the default time range? This field could default to 1hr, and it wouldn't be any different than it is now. The PHP frontend would then pull that value from the database, and it could be overwritten by the frontend if another range is chosen?

        In the meantime, I think I will just hardcode the time range to 8 hours (86400 seconds). This is from charts.php in 1.1alpha2.

        if(!isset($_GET["period"]))
        {
        $_GET["period"]=86400;
        }


        And to change the range in the screens... screens.php:

        if(DBnum_rows($iresult)>0)
        {
        if($resource == 0)
        {
        echo "<a href=charts.php?graphid=$resourceid><img src='chart2.php?graphid=$resourceid&width=$width&h eight=$height&period=86400&border=0' border=0></a>";
        }
        else if($resource == 1)
        {
        echo "<a href=history.php?action=showhistory&itemid=$resour ceid><img src='chart.php?itemid=$resourceid&width=$width&hei ght=$height&period=86400&border=0' border=0></a>";
        }


        Basically just change the 2 &period=3600 to whatever range you want, in seconds.

        NOTE: I haven't tested this to see if it breaks anything else, but it works for me.

        joe

        Comment

        Working...