所以,我在使用 Highcharts 时遇到了一些问题。它最近出现了一个仅在 Internet Explorer 8 中触发的错误。失败的行来自 highcharts.src.js 文件的第 270 行:
function css (el, styles) {
if (isIE) {
if (styles && styles.opacity !== UNDEFINED) {
styles.filter = 'alpha(opacity='+ (styles.opacity * 100) +')';
}
}
extend(el.style, styles); // This line fails...
}
创建图表的代码如下:
$(document).ready(function() {
chartcontainer1700 = new Highcharts.Chart({
chart: {
renderTo: 'container1700'
},
title: {
text: 'Loading chart...'
}
});
});
function onSuccess(options){
if (options.hasOwnProperty('restErrorMessage') && options.restErrorMessage != null) {
alert(options.restErrorMessage);
}
chartcontainer1700.destroy();
chartcontainer1700 = new Highcharts.Chart(options);
chartcontainer1700.redraw();
};
onSuccess
在 web 服务调用成功提供 Json 图表数据后触发函数,如下所示:
{"chart": {
"renderTo":"container0438",
"zoomType":"xy"},
"credits": {
"enabled": false,
"position": {
"align":"right",
"x":-10,
"verticalAlign":"bottom",
"y":-5
},
"href":"http:\/\/www.website.com",
"text":"Chart"
},
"legend": {
"borderRadius":0,
"borderWidth":0,
"enabled":true
},
"series":[{"data":[67.5,67.75],"name":"ME","type":"spline","yAxis":0}],
"title":{"align":"center","text":""},
"xAxis":[{
"categories":["Mar 22, 2011 - Mar 26, 2011","Mar 27, 2011 - Mar 29, 2011"],
"maxPadding":5,"minPadding":1
}],
"yAxis":[{
"labels":{
"style":{"color":"Gray"}
},
"opposite":false,
"title":{"text":"ME %","style":{"color":"Gray"}},
"type":"spline"}],
"exporting":{"enabled":true}
}
在其他浏览器中一切正常。有什么想法吗?
谢谢!