here is the fix:
This bug seems to have been fixed with the help of HBR Labs ?
By looking into the flash code, they noticed that with and height parameters are not passed to the FlashVars parameter.
The quick fix was to send these values with the xml:
urlToXml = "dataURL="+xml+"&chartwidth="+size[0]+"&chartheight="+size[1];
The correct solution is to fix it within FusionCharts.js. the code here does try to pass relevant parameters to the FlashVars parameter:
//Pass width and height to be appended as chartWidth and chartHeight
this.addVariable('chartWidth', w);
this.addVariable('chartHeight', h);
However, in the getSWFHTML () method the implementation is bad and does not append it to the parameter sent from the client
In getSWFHTML: function() {
} else { // PC IE
swfNode = '';
swfNode += '';
var params = this.getParams();
for(var key in params) {
swfNode += '';
}
var pairs = this.getVariablePairs().join("&");
if(pairs.length > 0) {swfNode += '';}
swfNode += "";
}
- flashvars is lowercase
- if the client passes a FlashVars param they are not appended.
The fix (done on MBM and BIT):
?
getSWFHTML: function() {
var swfNode = "";
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
// netscape plugin architecture
swfNode = '
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
var params = this.getParams();
var pairs = this.getVariablePairs().join("&");
for(var key in params) {
/*
HBR fix - pass variables to the FlashVars parameter
*/
//handle FlashVars
if("FlashVars"==key)
pairs += "&" + params[key];
else
swfNode += [key] +'="'+ params[key] +'" ';
}
//handle FlashVars
if(pairs.length > 0)
swfNode += 'FlashVars="'+ pairs +'"';
swfNode += '/>';
} else { // PC IE
swfNode = '';
swfNode += '';
var params = this.getParams();
var pairs = this.getVariablePairs().join("&");
for(var key in params) {
/*
HBR fix - pass variables to the FlashVars parameter
*/
//handle FlashVars
if("FlashVars"==key)
pairs += "&" + params[key];
else
swfNode += '';
}
//handle FlashVars
if(pairs.length > 0)
swfNode += '';
swfNode += "";
}
alert(swfNode);
return swfNode;
},