Jump to content









Photo

graph.js error from Graph Wizard

chart graph wizard

  • Please log in to reply
1 reply to this topic

#1 ductape312

ductape312

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 08 February 2015 - 06:36 PM

Has anyone else had an error with the javascript graph.js from the Wizard Widget Graphs?  I followed the Adafruit data logging tutorial (https://learn.adafru...odules?view=all) but the graph doesn't show up on my web page. I can see the data appearing on the device page on Carriots.  I used the Publish Data -> Wizard Widget Graphs to generate the code to embed on my web page and the graph doesn't show up.  I used the chrome javascript console and saw this error: "Uncaught TypeError: Cannot set property of 'innerHTML' of null"

Screen Shot 2015-02-08 at 1.29.15 PM.png

. This seems like an error in the graph.js file on Carriots server.  Does anybody know what the issue is? 

(function(){var g=document.getElementsByTagName("body")[0],h=0,k=!1;serialize=function(b){var d=[],a;for(a in b)d.push(encodeURIComponent(a)+"="+encodeURIComponent(b[a]));return d.join("&")};(function(){window.onload=function(){function b(d,a){var c=document.createElement("script"),b="undefined"!=typeof a.id?a.id:"carriots-graph";delete a.id;name="carriots"+ ++h;var f="?callback="+name+"&"+serialize(a);c.src="https://api.carriots.com/streams/"+f;g.appendChild(c);window[name]=function(e){d(e,a,c,b)}}
carriots_callback=function(b,a,c,h){function f(a){var b=document.createElement("script");b.async=!1;b.type="text/javascript";var c=e[a].innerText||e[a].textContent;c?b.text=c.replace(/\n/g,""):b.src=e[a].getAttribute("xlink:href");if("undefined"!=typeof e[--a]){var d=f(a--);b.onreadystatechange=b.onload=function(){var a=b.readyState;!d||d.done||a||(d.done=!0,d())}}g.appendChild(b)}g.removeChild(c);c=document.getElementById(h);if(-1===a.mime.indexOf("xml"))c.innerHTML='<img src="data:'+a.mime+";base64,"+
b.html+'" alt="carriots graph">';else if(c.innerHTML=b.html,!k){k=!0;var e=c.getElementsByTagName("script");e.length&&f(e.length-1)}};if("[object Array]"!==Object.prototype.toString.call(carriots))"undefined"!==typeof carriots.mime&&b(carriots_callback,carriots);else for(length=carriots.length,i=0;i<length;i++)"undefined"!==typeof carriots[i].mime&&b(carriots_callback,carriots[i])}})()})();

 

Attached Files



#2 dompablo

dompablo

    Master of Puppets

  • Members
  • PipPip
  • 14 posts

Posted 13 February 2015 - 08:34 AM

Hi ductape312,

 

Can you check that you have a HTML DIV tag to draw the graph?

 

 <div id="carriots-graph" style="max-width:900px; margin:auto;"></div>

 

You can find information about graphs here https://www.carriots...entation/graphs

 

Hope it helps!







Also tagged with one or more of these keywords: chart, graph, wizard

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users