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

trail 支持断开的情况 #5184

Closed
pearmini opened this issue Jun 9, 2023 Discussed in #5183 · 0 comments · Fixed by #5227
Closed

trail 支持断开的情况 #5184

pearmini opened this issue Jun 9, 2023 Discussed in #5183 · 0 comments · Fixed by #5227
Assignees
Labels

Comments

@pearmini
Copy link
Member

pearmini commented Jun 9, 2023

Discussed in #5183

Originally posted by blacksidev98 June 9, 2023
如下图的折线图能用轨迹表达出来
image
以下是本例的代码

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  theme: 'classic',
  autoFit: true,
});

chart.data({
  type: 'fetch',
  value: 'https://assets.antv.antgroup.com/g2/aapl.json',
});

chart
  .line()
  .encode('x', (d) => new Date(d.date))
  .encode('y', (d) => (new Date(d.date).getUTCMonth() <= 3 ? NaN : d.close))
  .encode('size', 'close')
  // .style('shape', 'trail')

chart.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant