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

Tooltip is not displayed for the second view. #6130

Closed
peaceps opened this issue Mar 14, 2024 · 5 comments · Fixed by #6142
Closed

Tooltip is not displayed for the second view. #6130

peaceps opened this issue Mar 14, 2024 · 5 comments · Fixed by #6142
Labels

Comments

@peaceps
Copy link

peaceps commented Mar 14, 2024

问题描述

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

const chart = new Chart({
  container: 'container',
  width: 928,
  height: 320,
  paddingLeft: 90,
  paddingBottom: 60,
});

const data = [
  [
    { x: 1, y: 2},
    { x: 2, y: 6},
    { x: 3, y: 4},
    { x: 4, y: 9}
  ],
  [
    { x: 1, y: 3},
    { x: 2, y: 6},
    { x: 3, y: 7},
    { x: 4, y: 9}
  ]
];
const spaceFlex = chart.spaceFlex();

for (let i = 0; i < data.length; i++) {
    const view = spaceFlex.view();
    
    view.data(data[i])
      .axis({
        x: {
            title: 'X',
            line: true,
            lineLineWidth: 1,
            grid: false
        },
        y: {
            title: 'Y',
            line: true,
            lineLineWidth: 1,
            grid: true,
            gridLineWidth: 2
        }
      })
      .line()
      .encode('x', 'x')
      .encode('y', 'y')
      .tooltip();
}
chart.render();

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@pearmini
Copy link
Member

这个看上去只有 line 有这个问题,我看 point 没有这个问题?

@pearmini pearmini added the Bug label Mar 15, 2024
@peaceps
Copy link
Author

peaceps commented Mar 15, 2024

area也有这个问题

@peaceps
Copy link
Author

peaceps commented Mar 17, 2024

顺便问一下 heatmap是没有legend的吗? 而且scale.palette也不生效

@pearmini
Copy link
Member

顺便问一下 heatmap是没有legend的吗? 而且scale.palette也不生效

有具体代码吗,官网案例应该是有的?

@peaceps
Copy link
Author

peaceps commented Mar 21, 2024

顺便问一下 heatmap是没有legend的吗? 而且scale.palette也不生效

有具体代码吗,官网案例应该是有的?

不是cell(),是heatmap(),不过这个问题不大

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