legend隐藏不想显示的图例
在 echart中 显示隐藏部分图例的办法:
option = { legend: { data: ['系列1', '系列2'], formatter: function (name) { // 返回空字符串隐藏图例 if(name=='系列1'){ return ''; } return name; } }, series: [ { name: '系列1', type: 'bar', data: [120, 200] }, { name: '系列2', type: 'line', data: [80, 100] } ] };
此时在
此处就不会显示 “系列1”的图例了。
浙公网安备 33010602011771号