Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(event): emit plot events #5034

Merged
merged 1 commit into from
May 16, 2023
Merged

feat(event): emit plot events #5034

merged 1 commit into from
May 16, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented May 16, 2023

Plot Event

支持监听 plot event.

开始使用

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',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis('y', { labelFormatter: '.0%' });

chart.render();

chart.on('plot:click', () => console.log('plot'));

@pearmini pearmini force-pushed the feat/plots-event branch from 7e1071f to f68a89d Compare May 16, 2023 08:44
@pearmini pearmini requested review from hustcc and pepper-nice May 16, 2023 08:45
@pearmini pearmini force-pushed the feat/plots-event branch from f68a89d to 40f4b61 Compare May 16, 2023 08:47
@pearmini pearmini force-pushed the feat/plots-event branch from 40f4b61 to abfb016 Compare May 16, 2023 08:49
@pearmini pearmini merged commit 67576ac into v5 May 16, 2023
@pearmini pearmini deleted the feat/plots-event branch May 16, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants