apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.48k stars 19.62k forks source link

柱状图默认mouseout事件报错 #2501

Closed CastielCheng closed 7 years ago

CastielCheng commented 8 years ago

echarts版本是2.2.7,使用的是横向柱状图,mouseout事件报t.className.match is not a function, 加上myChart.un(echarts.config.EVENT.MOUSEOUT)这句也不起作用, 重写MOUSEOUT事件,阻止事件冒泡也不起作用。

var option = {
    animation : true,
    legend: {
        data:[''],
        show:false
    },
    title : {
        text : '',
        x : 'center',
        y : 'top',
        padding : 0
    },
    tooltip : {
        'trigger' : 'axis',
        formatter : "{b}:{c}"
    },
    grid : {
        x : 70,
        y : 20,
        x2 : 30,
        y2 : 40
    },
    xAxis : [ {
        'type' : 'value',
        boundaryGap : [ 0, 0.1 ]
    } ],
    yAxis : [ {
        'type' : 'category',
        'axisLabel' : {
            show : false
        },
        'data' : []
    } ],
    series : [ {
        type : 'bar',
        data : [],
        barMinHeight : 2,
        barWidth : 10,
        boundaryGap : false,
            itemStyle : {
                normal : {
                    label : {
                        show : true,
                            position : 'right',
                                formatter : function(params, newWord, value) {
                                    return params.name + ":" + params.value;
                                }
                     }
                 }
            },
       barGap : '50%'
    } ]
};

效果图: qq 20160125151958 qq 20160125152148 qq 20160125152329

Tedko commented 8 years ago

2016-01-26 6 20 13 一样的问题

flyher commented 8 years ago

这个问题的解决可以参考1楼的方案:

2266