Ero sivun ”Widget:Ice break-up river graph” versioiden välillä
Järvi-meriwikistä
(Ak: Uusi sivu: <includeonly> <!--Load the AJAX API--> <!-- <script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.min.js"></script> --> <script type="text/javascript" s...) |
p (Tekstin korvaus – ”google.setOnLoadCallback(” muotoon ”google.charts.setOnLoadCallback(”) |
||
(3 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 9: | Rivi 9: | ||
var SiteID = '<!--{$SiteID|default:x|escape:'html'}-->'; | var SiteID = '<!--{$SiteID|default:x|escape:'html'}-->'; | ||
− | + | function <!--{$id|default:drawIburChart|escape:'html'}-->_jQueryTest() { | |
− | + | if ( typeof window.jQuery == 'undefined' ) { | |
+ | setTimeout( function(){ <!--{$id|default:drawIburChart|escape:'html'}-->_jQueryTest() }, 300); | ||
+ | } else { | ||
+ | google.charts.load( 'current', { 'packages':[ 'corechart' ], 'language': 'fi' } ); | ||
+ | google.charts.setOnLoadCallback(<!--{$id|default:drawIburChart|escape:'html'}-->_func); | ||
+ | } | ||
+ | } | ||
+ | setTimeout( function(){ <!--{$id|default:drawIburChart|escape:'html'}-->_jQueryTest() }, 300); | ||
− | + | function <!--{$id|default:drawIburChart|escape:'html'}-->_func() { | |
var searchStr = "action=ask&query="; | var searchStr = "action=ask&query="; | ||
Rivi 52: | Rivi 59: | ||
resultItem = request.query.results[i].printouts; | resultItem = request.query.results[i].printouts; | ||
− | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0])); | + | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0].timestamp)); |
if (obsDate.getFullYear() < firstYear) { firstYear = obsDate.getFullYear(); } | if (obsDate.getFullYear() < firstYear) { firstYear = obsDate.getFullYear(); } | ||
if (obsDate.getFullYear() > lastYear) { lastYear = obsDate.getFullYear(); } | if (obsDate.getFullYear() > lastYear) { lastYear = obsDate.getFullYear(); } | ||
Rivi 97: | Rivi 104: | ||
resultItem = request.query.results[i].printouts; | resultItem = request.query.results[i].printouts; | ||
− | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0])); | + | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0].timestamp)); |
sigma1 += (obsDate.getFullYear() - yearMean) * (obsDate.getDayOfYear() - daysMean); | sigma1 += (obsDate.getFullYear() - yearMean) * (obsDate.getDayOfYear() - daysMean); | ||
Rivi 116: | Rivi 123: | ||
zi++; | zi++; | ||
resultItem = request.query.results[i].printouts; | resultItem = request.query.results[i].printouts; | ||
− | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0])); | + | obsDate = new Date(toDateFromSecsSince1970(resultItem.Päivämäärä[0].timestamp)); |
dataRow = new Array(); | dataRow = new Array(); | ||
dataRow[0] = obsDate.getFullYear(); | dataRow[0] = obsDate.getFullYear(); |