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

docs(demo): use chart.mark #5822

Merged
merged 1 commit into from
Nov 21, 2023
Merged

docs(demo): use chart.mark #5822

merged 1 commit into from
Nov 21, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Nov 21, 2023

  • 更新 g2-extension-ava 相关案例使用 Mark 的方式。
  • 给 g2-extension-ava 相关案例添加 AVA 和 g2-extension-ava 的 github 的链接。
// Before
import { Runtime, corelib, extend } from '@antv/g2';
import { autolib } from '@antv/g2-extension-ava';

const Chart = extend(Runtime, {
  ...corelib(),
  ...autolib(),
});

const chart = new Chart({
  container: 'container',
});

chart.auto().data([
  { price: 100, type: 'A' },
  { price: 120, type: 'B' },
  { price: 150, type: 'C' },
]);

chart.render();
// After
import { Chart } from '@antv/g2';
import { Auto } from '@antv/g2-extension-ava';

const chart = new Chart({
  container: 'container',
});

// 通过 chart.mark 直接使用 Auto Mark
chart.mark(Auto).data([
  { price: 100, type: 'A' },
  { price: 120, type: 'B' },
  { price: 150, type: 'C' },
]);

chart.render();

Copy link
Contributor

@LAI-X LAI-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@pearmini pearmini merged commit 87c3860 into v5 Nov 21, 2023
3 checks passed
@pearmini pearmini deleted the demo-intelligent branch November 21, 2023 03:47
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.

None yet

2 participants