G30071 Report post Posted July 28, 2014 Hi, How to use Require.js and Fusioncharts.js ? Show an example of using ? Share this post Link to post Share on other sites
Vishalika Report post Posted August 4, 2014 (edited) Hi, What is your motive behind including FusionCharts JavaScript files in Require.js ? "fusioncharts.js" file is added in the code explicitly. Rest of the JavaScript files will be loaded automatically. The only requirement is that all the *.js files should be present in the same folder as "fusioncharts.js". Edited August 4, 2014 by Vishalika Share this post Link to post Share on other sites
G30071 Report post Posted August 9, 2014 Hi, I want to use fusioncharts in new CMS http://pagekit.com/ Please show an example of using Share this post Link to post Share on other sites
sharbel Report post Posted August 11, 2014 Hi The issue is very simple. Will try to explain here since we found a few posts here as well as in stack overflow where the replies gave a sense of lack of clarity . Script loaders like requirejs, yepnope, headjs are used to manage script dependencies, load scripts conditionally, load scripts when required or to combine dependent scripts into one for faster loading.In this example, like in ours, the chart functionality is only available to a few power users. So why load it for all users. Also the charts are only a side functionality, so it only require to be loaded if the user wants to see the chart. So we use require in this project to manage when the scripts have to be loaded with the required dependencies. And we use a lot of open source js libraries as well as a lot of our own. But for minor glitches we have got them to work. As of today (version 3.4.0), trial version downloaded a few weeks back, the fusion chart does not work with require. You do not need a testbed or test script, you just need to define the dependencies in a shim in require as shown below and try to get it working. shim: { 'fusionchart':{deps:['jquery']}, 'fusionthemes':{deps:['fusionchart']}, ... ... } We cannot point out the issue as we only have the minified files, but one reason could be that Raphael that Fusion is dependent on is not compatible with AMD or require. Script loaders (especially require) are used by a lot of people and is still on the rise. I think it is really important for a company like fusion chart to support require. So instead of asking for test scripts and beds, you should really talk to your development team as well as the management about this. We are all sure they already understand the issue or/ and will definitely close this hole for the future. Regards sharbel Share this post Link to post Share on other sites
G30071 Report post Posted August 17, 2014 Hi, Sample: require.config({ paths: { fusioncharts: 'themes/alpha/assets/js/fusioncharts', fusionthemes: 'themes/alpha/assets/js/fusioncharts.charts' }, shim: { 'fusioncharts':{deps:['jquery']}, 'fusionthemes':{deps:['fusioncharts']} } }); in page : <script> require(['fusioncharts', 'fusionthemes'], function() { FusionCharts.ready(function(){ var revenueChart = new FusionCharts({ "type": "column2d", .... .... .... }); revenueChart.render(); }); }); </script> Error: Share this post Link to post Share on other sites
Sanjukta Report post Posted September 29, 2014 Hi, Sample: require.config({ paths: { fusioncharts: 'themes/alpha/assets/js/fusioncharts', fusionthemes: 'themes/alpha/assets/js/fusioncharts.charts' }, shim: { 'fusioncharts':{deps:['jquery']}, 'fusionthemes':{deps:['fusioncharts']} } }); in page : <script> require(['fusioncharts', 'fusionthemes'], function() { FusionCharts.ready(function(){ var revenueChart = new FusionCharts({ "type": "column2d", .... .... .... }); revenueChart.render(); }); }); </script> Error: Hi, Apologies for the delay. Could you please upgrade your current version to the latest, i.e, FusionCharts Suite v3.4.1 that includes the fixes to the previously reported issues and see if this helps? Awaiting your feedback. Share this post Link to post Share on other sites
G30071 Report post Posted October 2, 2014 Hi, Apologies for the delay. Could you please upgrade your current version to the latest, i.e, FusionCharts Suite v3.4.1 that includes the fixes to the previously reported issues and see if this helps? Awaiting your feedback. Hi, it works !!! Thanks. Share this post Link to post Share on other sites
Sanjukta Report post Posted October 10, 2014 Hi, it works !!! Thanks. Glad that your issue is resolved. Happy FusionCharting!! Share this post Link to post Share on other sites