Difference between revisions of "Widget:Napchart"

From Polyphasic Sleep Wiki
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 
<script>
 
<script>
   eval("var ctx_" + "<!--{$url|escape:'html'}-->".slice(21) + " = document.getElementById(\"nc-<!--{$url|escape:'html'}-->\").getContext('2d')")
+
   eval("var ctx_" + "<!--{$url|escape:'html'}-->".split('/').pop() + " = document.getElementById(\"nc-<!--{$url|escape:'html'}-->\").getContext('2d')")
   $.getJSON('https://cache.polysleep.org/napcharts/' + "<!--{$url|escape:'html'}-->".slice(21) + ".json, function(data) {
+
   $.getJSON('https://cache.polysleep.org/napcharts/' + "<!--{$url|escape:'html'}-->".split('/').pop() + ".json", function(data) {
     eval("var myNapchart_" + "<!--{$url|escape:'html'}-->".slice(21) + " = Napchart.init(ctx_" + "<!--{$url|escape:'html'}-->".slice(21) + ", data['chartData'])");
+
     eval("var myNapchart_" + "<!--{$url|escape:'html'}-->".slice(21) + " = Napchart.init(ctx_" + "<!--{$url|escape:'html'}-->".split('/').pop() + ", data['chartDocument']['chartData'])");
 
     console.log(data);
 
     console.log(data);
 
});
 
});
 
</script>
 
</script>
 
</includeonly>
 
</includeonly>

Latest revision as of 23:11, 13 July 2021