8000 [Bug]: chart.emit('sliderX:filter') 准确性不是百分百,时好时错 · Issue #6970 · antvis/G2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Bug]: chart.emit('sliderX:filter') 准确性不是百分百,时好时错 #6970
Open
@linjc

Description

@linjc

Describe the bug / 问题描述

更改预设值,X轴的值没问题,但X轴滑动条的数值范围时对时错。

Image Image Image

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

复现代码如下,可手动更改start或end值进行测试

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

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

chart
  .cell()
  .data({
    type: 'fetch',
    value: 'https://assets.antv.antgroup.com/g2/seattle-weather.json',
  })
  .transform({ type: 'group', color: 'max' })
  .encode('x', (d) => new Date(d.date).getUTCDate())
  .encode('y', (d) => new Date(d.date).getUTCMonth())
  .encode('color', 'temp_max')
  .style('inset', 0.5)
  .scale('color', { palette: 'gnBu' })
  .animate('enter', { type: 'fadeIn' })
  .slider('y')
  .slider('x');

setTimeout(() => {
  const start = 4, end = 20;
  chart.emit('sliderX:filter', { data: { selection: [[start, end], undefined] }, nativeEvent: false })
}, 1000)

chart.render();

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for maintainerTriage or intervention needed from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0