javascript - Unable to get property '1' of undefined or null reference for Highcharts in IE8 -
i'm trying use highchart in ie8 error:
unable property '1' of undefined or null reference
according website, highcharts works down ie6, should work fine in ie8... works fine in other browsers i've tested on.
any ideas problem is?
i've set fiddle here errors when tested in ie8: http://jsfiddle.net/w1ebp44w/
(probably best test full result in ie: http://jsfiddle.net/w1ebp44w/embedded/result/)
the code follows:
highcharts.theme = { colors: [ '#5e2750', '#eb9700', '#007c92', '#a8b400' ] }; var highchartsoptions = highcharts.setoptions(highcharts.theme); // radialize colors highcharts.getoptions().colors = $.map(highcharts.getoptions().colors, function(color) { return { radialgradient: { cx: 0.5, cy: 0.3, r: 0.7 }, stops: [ [0, color], //[1, highcharts.color(color).brighten(-0.1).get('rgb')] // darken ] }; }); // build chart var options = { chart: { //renderto: 'chart', plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false, backgroundcolor: 'transparent', spacingtop: 0, spacingleft: 0, spacingright: 0, spacingbottom: 0, animation: false, shadow: false, type: 'pie' }, credits: { enabled: false }, title: { text: null }, tooltip: { enabled: false, formatter: function() { return '<b>' + this.point.name + '</b> : ' + math.round(this.percentage) + '%'; } }, plotoptions: { pie: { animation: true, allowpointselect: false, datalabels: { enabled: true, //format: '<b style="font-weight:400;font-family:vodafonebold;">{point.name}</b> {point.y}/{point.total} ({point.percentage:.1f}%)', formatter: function(){ return '<b style="font-weight:400;font-family:arial;">' + this.point.name + '</b> ' + this.point.y + '/' + this.point.total + ' (' + this.point.percentage.tofixed(0) + '%)'; }, style: { "color": "#666", "fontsize": "18px", "fontweight": "400", "fontfamily": "arial" } }, shadow: false }, series: { states: { hover: { enabled: false } } } }, series: [{ data: [{ name: 'basic', x: 0, y: math.round( 1 ) }, { name: 'intermediate', x: 0, y: math.round( 2 ) }, { name: 'advanced', x: 0, y: math.round( 3 ) }, { name: 'expert', x: 0, y: math.round( 4 ) }] }] }; $(document).ready(function(){ $('#chart').highcharts(options).highcharts(); });
ie8 has issues trailing commas
stops: [ [0, color], <-- remove trailing comma
Comments
Post a Comment