antvis/G2

tooltip设置marker:false无效 #6520

the-lemonboy posted onGitHub

问题描述

tooltip设置marker:false之后marker还是显示。

重现链接

No response

重现步骤

const data = [ { name: '水体', area: 300 }, { name: '绿地', area: 254 }, { name: '农田', area: 224 }, { name: '裸地', area: 210 }, { name: '居民用地', area: 821 }, { name: '商业用地', area: 621 }, { name: '教育机构', area: 21 }, { name: '工业用地', area: 82 }, { name: '交通用地', area: 921 }, ];

const chart = new Chart({ container: 'Fan-Chart_container', width: 380, height: 380, theme: 'classicDark', });

chart.coordinate({ type: 'theta', outerRadius: 0.8 });

chart .interval() .data(data) .transform({ type: 'stackY' }) .encode('y', 'area') .encode('color', 'name') .legend('color', { position: 'bottom', itemMarker: 'circle', layout: { justifyContent: 'center' } }) .tooltip({ title: (d) => d.name, items: [ (d) => ({ name: '面积', value: d.area, channel: 'y', }), (d, i, data, column) => { const totalArea = data.reduce((sum, item) => sum + item.area, 0); const value = ${((d.area / totalArea) * 100).toFixed(2)}%; return { name: '面积占比', value, channel: 'y', }; }, ], // 这里设置了false marker: false, }); chart.render();

image

预期行为

期望效果:tooltip的marker不显示。

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


Fund this Issue

$0.00
Funded

Pull requests