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】多轴图缩略轴拖动时图形渲染异常 #5242

Open
Deathsteps opened this issue Jun 27, 2023 · 4 comments
Open

【v5】多轴图缩略轴拖动时图形渲染异常 #5242

Deathsteps opened this issue Jun 27, 2023 · 4 comments

Comments

@Deathsteps
Copy link
Contributor

问题描述

  1. 只配一个 X 轴的 slider, 拖不动
  2. 两个图 X 轴都配,滑动显示异常
  3. 配 Y 轴,也有相同问题

滑动前
image

滑动后
image

期望结果

问题1 我觉得,如果不能拖,是不是不显示比较好。
问题 2、3 应该是同一根源,滑动过程中应该正确显示范围内的图。

如何重现

官方代码修改

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

const data = [
  { time: '10:10', call: 4, waiting: 2, people: 2 },
  { time: '10:15', call: 2, waiting: 6, people: 3 },
  { time: '10:20', call: 13, waiting: 2, people: 5 },
  { time: '10:25', call: 9, waiting: 9, people: 1 },
  { time: '10:30', call: 5, waiting: 2, people: 3 },
  { time: '10:35', call: 8, waiting: 2, people: 1 },
  { time: '10:40', call: 13, waiting: 1, people: 2 },
];

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

chart.data(data);

chart
  .interval()
  .encode('x', 'time')
  .encode('y', 'waiting')
  .axis('y', { title: 'Waiting', style: { titleFill: '#5B8FF9' } })
  .slider('x', {})
  // .slider('y', {});

chart
  .line()
  .encode('x', 'time')
  .encode('y', 'people')
  .encode('shape', 'smooth')
  .style('stroke', '#fdae6b')
  .style('lineWidth', 2)
  .scale('y', { independent: true })
  .axis('y', {
    position: 'right',
    grid: null,
    title: 'People',
    style: {
      titleFill: '#fdae6b',
    },
  })
  .slider('x', {})
  // .slider('y', {});

chart.render();

额外信息

  • G2 5.0.13 版本
@pearmini
Copy link
Member

目前没有处理多轴图的缩略轴。

@Deathsteps
Copy link
Contributor Author

目前没有处理多轴图的缩略轴。

有计划吗:pray:

@pearmini
Copy link
Member

x 不能的拖的问题应该被这个 PR 修复了:#5280

@pearmini
Copy link
Member

目前没有处理多轴图的缩略轴。

有计划吗🙏

这个下半年应该会添加,因为还涉及到交互的触发问题,比较复杂。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants