Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

tootip提示有问题 #5677

Closed
18211365467 opened this issue Oct 24, 2023 · 2 comments
Closed

tootip提示有问题 #5677

18211365467 opened this issue Oct 24, 2023 · 2 comments

Comments

@18211365467
Copy link

18211365467 commented Oct 24, 2023

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

const xField = 'time';
const leftFields = [['call', 'waiting'], 'people'];
const rightFields = ['mock'];

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

chart.options({
  type: 'view',
  data: [
    { time: '10:10', call: 4, waiting: 2, people: 2, mock: 3 },
    { time: '10:15', call: 2, waiting: 6, people: 3, mock: 4 },
    { time: '10:20', call: 13, waiting: 2, people: 5, mock: 1 },
    { time: '10:25', call: 9, waiting: 9, people: 1, mock: 2 },
    { time: '10:30', call: 5, waiting: 2, people: 3, mock: 5 },
    { time: '10:35', call: 8, waiting: 2, people: 1, mock: 3 },
    { time: '10:40', call: 13, waiting: 1, people: 2, mock: 2 },
  ],
  children: [
    ...marks('left', xField, leftFields),
    ...marks('right', xField, rightFields),
  ],
});

chart.render();

function marks(position, xField, fields) {
  return fields.map((d, index) => {
    if (Array.isArray(d))
      return {
        type: 'interval',
        data: {
          transform: [{ type: 'fold', fields: d }],
        },
        encode: {
          x: xField,
          y: 'value',
          color: 'key',
          series: () => `(${position}, ${index})`,
        },
        transform: [{ type: 'stackY' }],
        scale: { y: { key: position } },
        axis: { y: { title: null, position } },
      };
    return {
      type: 'interval',
      encode: {
        x: xField,
        y: d,
        color: () => d,
        series: () => `(${position}, ${index})`,
      },
      scale: { y: { key: position } },
      axis: { y: { title: null, position } },
    };
  });
}
@18211365467 18211365467 changed the title tootip tootip提示有问题 Oct 24, 2023
@antvis antvis deleted a comment from 18211365467 Nov 1, 2023
@antvis antvis deleted a comment from 18211365467 Nov 1, 2023
@pearmini
Copy link
Member

pearmini commented Nov 1, 2023

可能是相关的问题:#5672

@pearmini
Copy link
Member

pearmini commented Nov 3, 2023

具体的问题是啥?

@antvis antvis locked and limited conversation to collaborators Nov 3, 2023
@pearmini pearmini converted this issue into discussion #5734 Nov 3, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants