antvis/G2



The issue has been closed
存在多个 transform 的情况下,Tooltip 默认不会展示堆叠前的数据 #5952
YiSiWang posted onGitHub
问题描述
#4681 提到 Tooltip 默认展示堆叠前的数据,但是如果存在 .transform({ type: 'groupColor', y: 'count' }) ,会导致 Tooltip 展示堆叠后的数据:
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
height: 640,
});
chart.coordinate({ type: 'theta', innerRadius: 0.6 });
chart
.interval()
.transform({ type: 'groupColor', y: 'count' })
.transform({ type: 'stackY' })
.data(
[
{ name: 'A' },
{ name: 'A' },
{ name: 'A' },
{ name: 'B' },
{ name: 'C' },
]
)
.encode('color', 'name')
.style('stroke', 'white')
.style('inset', 1)
.style('radius', 10)
.scale('color', {
palette: 'spectral',
offset: (t) => t * 0.8 + 0.1,
})
.animate('enter', { type: 'waveIn' })
.legend(false);
chart.render();
- 如何展示堆叠前的数据?
- 是否应该默认展示堆叠前?
重现链接
No response
重现步骤
No response
预期行为
No response
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
屏幕截图或视频(可选)
No response
补充说明(可选)
No response