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

[v5] Tooltip 在多 mark 下的并存问题 #4562

Closed
visiky opened this issue Jan 9, 2023 · 2 comments · Fixed by #4693
Closed

[v5] Tooltip 在多 mark 下的并存问题 #4562

visiky opened this issue Jan 9, 2023 · 2 comments · Fixed by #4693
Labels

Comments

@visiky
Copy link
Member

visiky commented Jan 9, 2023

描述

image

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

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

chart.interaction({ type: 'tooltip' })

chart
  .line()
  .data({
    type: 'fetch',
    value: 'https://assets.antv.antgroup.com/g2/forecast-range.json',
  })
  .encode('x', d => new Date(d[0]))
  .encode('y', d => d[4])
  .encode('tooltip', d => {
    return [{
      name: '数值',
      value: d[4]
    }]
  });

chart.point()
  .data([
    ['01-08', 0.417885699969663],
    ['01-23', 0.706678090635692],
    ['03-12', 6.0515889109663],
  ])
  .encode('x', (d) => new Date(d[0]))
  .encode('y', (d) => d[1])
  .encode('shape', 'point')
  .encode('color', '#FF6B3B')
  .encode('title', null)
  .encode('tooltip', d => {
    return d ? { name: '异常值', value: d[1] } : null
  })

chart.render();
@visiky visiky added the V5 label Jan 9, 2023
@visiky visiky modified the milestone: 5.0.0-beta.6 Jan 9, 2023
@pearmini
Copy link
Member

pearmini commented Jan 9, 2023

相同的问题:#4538

@visiky visiky reopened this Jan 11, 2023
@visiky
Copy link
Member Author

visiky commented Jan 11, 2023

point 只有两个异常点,在没有异常点的地方,tooltip 依然展示了数据

Aarebecca pushed a commit that referenced this issue Mar 1, 2023
* fix(tooltip): inferred tooltip should show raw column (close: #4681)

* fix(tooltip): sort items visually

* fix(tooltip): skip missing data

* fix(tooltip): series tooltip show hit item elements (close: #4562)
hustcc pushed a commit that referenced this issue May 16, 2023
* fix(tooltip): inferred tooltip should show raw column (close: #4681)

* fix(tooltip): sort items visually

* fix(tooltip): skip missing data

* fix(tooltip): series tooltip show hit item elements (close: #4562)
hustcc pushed a commit that referenced this issue May 16, 2023
* fix(tooltip): inferred tooltip should show raw column (close: #4681)

* fix(tooltip): sort items visually

* fix(tooltip): skip missing data

* fix(tooltip): series tooltip show hit item elements (close: #4562)
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.

2 participants