多个children时,手动调用toolTip失效 #5282
codeSnipe posted onGitHub
demo的config 可以出发click,无法触发'tooltip:show
chart?.on('element:click', (event: any) => { chart?.emit('tooltip:show', { data: { data: event.data.data, }, }); });
{ type: 'view', encode: { color: 'color' }, legend: { color: { title: false, itemMarker: 'square', }, }, children: [ { type: 'interval', data, encode: { x: 'x', y: 'y', size: 20, }, axis: { y: { title: false }, x: { title: false, }, }, tooltip: { title: { channel: 'x' }, items: [ { channel: 'y', name: ' ', }, ], }, }, { type: 'line', encode: { x: 'x', y: 'y', shape: 'smooth' }, scale: { y: { independent: true } }, data: data, tooltip: { title: { channel: 'x' }, items: [ { channel: 'y', name: ' ', }, ], }, axis: { x: { title: false, }, y: { position: 'right', grid: null, title: false, }, }, }, ], }}