romc
Posts: 1
Joined: Tue Aug 28, 2012 9:04 am

HC 2.3.0 - IE7/8: Invalid Argument Error

Hi,

Thanks for this wonderful library!
Since the release of 2.3.0, I've been facing a JavaScript error that occurs for every chart I try to display on IE 7 & 8 (didn't try on 9; FF & Chrome are not concerned); this even occur on the HighChart home page with the 2 top demo charts :-( and the basic http://jsfiddle.net/gh/get/jquery/1.7.2 ... ine-basic/ also raise the exception... 4 times: once for each serie)
IE7.PNG
IE7.PNG (6.51 KiB) Viewed 1821 times
Version 2.2.5 was working fine, so I dug into the source code to track down the problem...

The exception is raised by the extend method (line #124 of .src.js) when called by css method (line #286) previously called by the return statement of the clip method (line #4519); attached are the VisualWebDevelopper debugging print screens.

Apparently "hard" setting the 'clip' value to 'inherit' causes IE to refuse merging the css style objects.

I found 2 possible solutions to this issue, which prevent us to migrate to 2.3.0:
* Removing the default {clip: 'inherit' } prevent he exception to rise, but i'm sure there is a good reason for setting the default value here!
* or; in the css function (l. #286), under the isIE clause (since this occurs only in IE), using the setAttribute method on the el.styles object rather than setting the value directly is accepted (by IE only; so keeping the extend method for other browsers); like this :

Code: Select all

function css(el, styles) {
	if (isIE) {
		if (styles && styles.opacity !== UNDEFINED) {
			styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
		}
                // loop on styles to set them with setAttribute method, 
                // IE does not allow direct setting of style attributes
               if(styles) {
                    var s;
                    for (s in styles)
                        el.style.setAttribute(s, styles[s]);
                }
	}
        else 
            extend(el.style, styles);
}
Please let me know if you can reproduce this too!

Thanks,

Rom
Attachments
VWD.PNG
VWD.PNG (44.81 KiB) Viewed 1821 times
seba
Posts: 4415
Joined: Tue Jul 31, 2012 2:26 pm

Re: HC 2.3.0 - IE7/8: Invalid Argument Error

Sebastian Bochan
Highcharts Developer

Return to “Highcharts Usage”