图表在firefox和ie上没有显示任何内容

时间:2016-04-07 09:35:56

标签: internet-explorer firefox highcharts

我对highcharts有疑问。 http://jsfiddle.net/QurR6/5/

$('#container-graph-cac-40').highcharts({
    chart: {
        type: 'area',
        style: {
            //fontFamily: 'Roboto, Arial'
        }
    },
    title: {
        text: '',
        align: 'left',
        x:20,
        y:30
    },
    legend:{
        enabled:false,
    },
    tooltip: {
        dateTimeLabelFormats:{
            hour:'%H:%m'
        },
        shared: true,
        useHTML: true,
        crosshairs:true,
        borderColor: '#A7C34C',

        formatter: function() {
            var text =  '<table>'+
                        '<tr><td>Heure: </td><td style="text-align: right"><b>'+Highcharts.dateFormat('%H:%M', new Date(this.x))+'</b></td></tr>' + 
                        '<tr><td>Cours: </td><td style="text-align: right"><b>'+this.y+'</b></td></tr>' +
                        '<tr><td>Var: </td><td style="text-align: right"><b>'+datas[this.points[0].point.index][2]+'%</b></td></tr>' +
                        '</table>'
            return text;
        },

        valueDecimals: 2
    },
    xAxis: {
        type: 'datetime',
        tickWidth:0,
        minPadding: 0.0,
        alternateGridColor: Highcharts.Color('#F2F1ED').setOpacity(.8).get('rgba'),
        crosshair:{
            color:'#A7C34C'
        },
    },

    yAxis: [{
                lineWidth: 1,
                title: {
                    text: ''
                },
            }, 
            {
                gridLineDashStyle: 'dash',
                opposite: true,
                title: {
                    text: ''
                },
                min:min,
                max:max,
                plotLines: [{
                            color: 'red', // Color value
                            value: datas[0][3], // Value of where the line will appear
                            width: 1 // Width of the line    
                        }]
            }
    ],

    plotOptions: {
        series: {
            pointPadding: 0,
            groupPadding: 0,
            type: 'area',
            marker:{
                enabled:false,
                states:{
                    hover: {
                            fillColor: '#A7C34C',
                            lineColor:'#A7C34C',
                            radius:3
                    }
                }
            },
            states: {
                hover: {
                    enabled: true,
                    lineWidth: 1
                }
            },
            lineColor:'#A7C34C',
            lineWidth:1,
            fillColor: {
                linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
                stops: [
                    [0, '#D0E2A6'],
                    [1, Highcharts.Color('#D0E2A6').setOpacity(0).get('rgba')]
                ]
            }
        }
    },

    series: [{
        data: d,
        threshold: datas[0][3],
        negativeColor: 'red',
        color: '#D0E2A6',
        yAxis: 1
    }, {
        data: [],
    }],

    credits:{
        enabled:false
    }
});

此图表适用于chrome,但不适用于ff 45.0.1和ie9&amp; 11。它显示没有js错误和bug onmouseover的任何内容。

任何人都可以帮助我?

感谢。

1 个答案:

答案 0 :(得分:0)

我发现了问题! date不解析ff和ie:

var m = datas[i][0].split(' ')[0].split('-');
var h = datas[i][0].split(' ')[1].split(':');
d.push([Date.UTC(m[0], m[1], m[2], h[0], h[1], h[2], 0), datas[i][1]]);

http://jsfiddle.net/QurR6/6/