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

时间条形图时间靠近的时候,只显示其中一个条 #5252

Closed
pearmini opened this issue Jun 29, 2023 · 2 comments · Fixed by #5260
Closed

时间条形图时间靠近的时候,只显示其中一个条 #5252

pearmini opened this issue Jun 29, 2023 · 2 comments · Fixed by #5260
Labels

Comments

@pearmini
Copy link
Member

  • 版本:5.0.14
  • 问题:时间条形图时间靠近的时候,只显示其中一个条。
import { Chart } from '@antv/g2';

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

chart
  .interval()
  .coordinate({ transform: [{ type: 'transpose' }] })
  .data([
    {
      task: 'task0',
      startTime: '2023-06-28 03:30:33.900123',
      endTime: '2023-06-28 03:30:33.900678',
      status: '0',
    },
    {
      task: 'task0',
      startTime: '2023-06-28 03:30:33.901123',
      endTime: '2023-06-28 03:30:33.902678',
      status: '1',
    },
  ])
  .encode('x', 'task')
  .encode('y', [(d) => new Date(d.startTime), (d) => new Date(d.endTime)])

chart.render();
@pearmini
Copy link
Member Author

似乎第一个条的两个时间是一个时间?

image

@pearmini
Copy link
Member Author

目前 G2 支持的最小时间单位是毫秒,但是这个地方出现了微秒,所以无法处理了。

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