解决方案 »

  1.   

    应为你的语法错误了,ie6不支持json最后一项还加个逗号在后门。。在ie下会报错,标准浏览器可以那样写   function createChart() {
            chart = jQuery('#chartView').highcharts('StockChart', {
                chart: {
                    type: 'column'///////////////////////,
                },
                credits: {
                    enabled: false
                },
                rangeSelector: {                selected: 0, //设置zoom默认选项
                    buttons: [ //设置zoom 显示选项
                       {
                       type: 'minute',
                       count: 780,
                       text: '12h'
                   }, {
                       type: 'day',
                       count: 1,
                       text: '1d'
                   }, {
                       type: 'day',
                       count: 3,
                       text: '3d'
                   }, {
                       type: 'week',
                       count: 1,
                       text: '1w'
                   }, {
                       type: 'month',
                       count: 1,
                       text: '1m'
                   }, {
                       type: 'month',
                       count: 3,
                       text: '3m'
                   }, {
                       type: 'month',
                       count: 6,
                       text: '6m'
                   }, {
                       type: 'year',
                       count: 1,
                       text: '1y'
                   }, {
                       type: 'all',
                       text: 'All'
                   }],                inputEnabled: false// $('#container').width() > 760 //输入开启设置
                },
                xAxis: { //x轴
                    events: { //轴事件处理
                        setExtremes: function (e) { //设定最高和最低
                            //alert((e.max-e.min)/1000/3600/24);
                        }
                    },
                    type: "datetime",
                    tickPixelInterval: 150, //像素间隔
                    ordinal: false,
                    dateTimeLabelFormats: { //自动调整日期格式
                        second: '%Y年%m月%d日 %H:%M:%S',
                        minute: '%Y年%m月%d日 %H:%M',
                        hour: '%Y年%m月%d日 %H:%M',
                        day: '<strong>%Y年%m月%d日</strong>',
                        week: '%Y年%m月%d日',
                        month: '<strong>%Y年%m</strong>',
                        year: '<strong>%Y</strong>'
                    }
                },
                yAxis: {
                    showLastLabel: true
                },            plotOptions: {
                    line: {
                        dataGrouping: {
                            enabled: false  //关闭数据分组
                        }
                    }
                },
                tooltip: {
                    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> <br/>',
                    valueDecimals: 2
                },
                series: seriesOptions///////////////////////,
            });
        }