Jump to content









Photo

Timezone for graph

timezone graph

  • Please log in to reply
1 reply to this topic

#1 dragonself

dragonself

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 16 May 2017 - 06:11 AM

Do the graph java-script library allowed to set timezone as parameter? My data showing correct date time in the cpanel but it is all in time zone +00:00 in the graphs.

 

Thanks,

Philip



#2 Yoleon

Yoleon

    Sugar Master

  • Members
  • PipPipPip
  • 31 posts

Posted 18 May 2017 - 10:31 AM

Hi Dragonself,

 

You can set the timezone in the script adding the parameter "tz" at the json. (example: "tz": "Europe/Amsterdam").

 

 <script type="text/javascript">
        var carriots = {
            "apikey": "YOUR READ-ONLY APIKEY HERE",
            "mime": "image/svg+xml",
            "type": "bar",
            "axis[x]": "at",
            "axis[y]": "temperature",
            "data[0]": "temperature",
            "query[device]": "deviceName@userName",
            "query[sort]": "at",
            "query[order]": "asc",
            "query[max]": "10",
            "tz": "Europe/Amsterdam"
        };
    </script>

 

I wait for your answer,

 

Yoleon






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users