So here's the situation, I need to always force rendering of the charts in HTML rather than flash and that part's fairly easy. Now, the problem I have is that due to our environment, we have a firewall that does some file manipulation and/or injecting of scripts. So, the auto-includes that occur when trying to render and HTML 5 chart just flat out doesn't work. The files I'm talking about are: FusionCharts.HC.Charts.js, FusionCharts.HC.js, and jquery.min.js.
I found, while digging through the source code, that there's a function that's supposed to let you leave off the auto-loading of the files:
if (FusionCharts._doNotLoadExternalScript) {
FusionCharts._doNotLoadExternalScript({ jQuery: true, base:true, charts:true, powercharts:true, widgets:true, maps:true });
}
Unfortunately, that code doesn't work. After stepping through the debugger and trying to identify the problem, what I've come across in the main FusionCharts.js file is that calling this function is trying to set a boolean property on a string - this won't work as you can only set a property on a Javascript Object, not a string. Here's the code from FusionCharts.js:
_doNotLoadExternalScript: function (flags) {
var item, srcKey;
for (item in flags) {
srcKey = item.toLowerCase();
if (moduleMeta[srcKey]) {
moduleMeta[srcKey] = {};
moduleMeta[srcKey].blocked = new Boolean(flags[item]);
}
}
},
The problem occurs in the moduleMeta[srcKey] line. moduleMeta[srcKey] is always a string - here's the excerpt from the source:
moduleMeta = lib.moduleMeta = {
jquery: 'jquery.min.js',
base: 'FusionCharts.HC.js',
charts: 'FusionCharts.HC.Charts.js',
powercharts: 'FusionCharts.HC.PowerCharts.js',
widgets: 'FusionCharts.HC.Widgets.js',
maps: 'FusionCharts.HC.Maps.js'
}
So, essentially you're trying to set moduleMeta.jquery.blocked = true...but you can't do that. Because moduleMeta.jquery is "jquery.min.js". So you're really trying to do this: moduleMeta."jquery.min.js".blocked = true ...this is invalid and will never work because you can't set a property on a string value.
All that being said, is there any way that anyone is aware of that I can merge all the necessary files and this thing just work? I've now spent two full days trying to work around this to no avail. It seems like every time I fix one thing another issue is broken, plus, my biggest fear is that as soon as a new release comes out I'll be back at square one. I really need a FusionCharts.all.js that includes everything so I don't have to mess with all this.
Thanks in advance,
Allen Underwood