How to dynamically load JS files in the RGraph?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Ileven on 16th April 2014
hi, Richard

    I want to reload dynamic the js-files which is in the libraries, the codes is

   "
     eval($.getScript("RGraph.common.core.js"));
     eval($.getScript("RGraph.common.tooltips.js"));
     eval($.getScript("RGraph.common.dynamic.js"));
     eval($.getScript("RGraph.common.key.js"));
     try {
       eval($.getScript("RGraph.bar.js"), function() {
             var c = new RGraph.Bar("cvsBar", data).draw();
         });
     } catch(e) {
         console.log(e);
     }

  "

but it doesn't work,and also there is no error information log show? How to dynamic load those files?
Posted by Richard on 16th April 2014
Hi there,

I don't think you'll need the eval() calls, plus you'll want to wait until all the scripts are loaded until you create the bar chart. There's a stackoverflow question about that here:

stackoverflow.com/questions/11803215/how-to-include-multiple-js-files-using-jquery-getscript-method




Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

Add a reply

 




« Back to message list
RGraph on social media