Difference between revisions of "Widget:Napchart"

From Polyphasic Sleep Wiki
m
m
Line 7: Line 7:
 
<script>
 
<script>
 
   var ctx = document.getElementById("nc-<!--{$url|escape:'html'}-->").getContext('2d')
 
   var ctx = document.getElementById("nc-<!--{$url|escape:'html'}-->").getContext('2d')
   var id = "<!--{$url|escape:'html'}-->".slice(21)
+
   $.getJSON('https://zandimna6174-eval-prod.apigee.net/get?chartid=' + "<!--{$url|escape:'html'}-->".slice(21), function(data) {
  $.getJSON('https://zandimna6174-eval-prod.apigee.net/get?chartid=' + id, function(data) {
+
     eval("var myNapchart_" + "<!--{$url|escape:'html'}-->".slice(21) + " = Napchart.init(ctx, data['chartData'])");
     eval("var myNapchart_" + id + " = Napchart.init(ctx, data['chartData'])");
 
 
     console.log(data)
 
     console.log(data)
 
});
 
});

Revision as of 11:57, 12 December 2020