antvis/G2

interval图,如何隐藏 tooltip #5003

wanglihuaya posted onGitHub

interval图,如何隐藏 tooltip

chart.interaction('tooltip', { body:false, });

复现代码

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();

没有效果


Fund this Issue

$0.00
Funded

Pull requests