myChart.on('legendselectchanged', function(params) {
var name = params.name;
if(name == '全部'){
var selected = params.selected;
var flag = selected[name];

        var selectArr = myChart.getOption().legend[0].data;
        var obj = {};
        for(var key in selectArr){
            obj[selectArr[key]] = flag;
        }    
        option.legend.selected = obj;
        myChart.setOption(option);
        }
});