interval图,如何隐藏 tooltip #5004
-
interval图,如何隐藏 tooltip chart.interaction('tooltip', { 复现代码 import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
theme: 'classic',
autoFit: true,
});
chart
.interval()
.data({
type: 'fetch',
value:
'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
})
.transform([{ type: 'sortX', by: 'y', reverse: true, slice: 5 }])
.encode('x', 'letter')
.encode('y', 'frequency')
.axis('y', { labelFormatter: '.0%' });
chart.interaction('tooltip', {
body:false,
crosshairs:false,
});
chart.render(); 没有效果 |
Beta Was this translation helpful? Give feedback.
Answered by
pearmini
May 11, 2023
Replies: 1 comment 5 replies
-
应该这样声明:
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
hustcc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
应该这样声明:
chart.interaction('tooltip', false)
chart.interaction('tooltip', { body:false});
针对折线图,只展示指标线,不展示 body。