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

[Bug]: slide 选项配置没有效果 #6608

Open
2 of 10 tasks
chenaaaa1111 opened this issue Feb 17, 2025 · 1 comment
Open
2 of 10 tasks

[Bug]: slide 选项配置没有效果 #6608

chenaaaa1111 opened this issue Feb 17, 2025 · 1 comment
Labels
waiting for author Further information is requested from the author

Comments

@chenaaaa1111
Copy link

Describe the bug / 问题描述

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

const data = [
        {
            "name": "10010",
            "time": "2025-02-17 08:24:58",
            "value": -4.6
        },
        {
            "name": "10010",
            "time": "2025-02-17 07:04:33",
            "value": 7.43
        },
        {
            "name": "10010",
            "time": "2025-02-17 03:20:37",
            "value": 18.29
        },
        {
            "name": "10010",
            "time": "2025-02-17 08:23:41",
            "value": 4.32
        },
        {
            "name": "10010",
            "time": "2025-02-17 11:56:56",
            "value": 9.54
        },
        {
            "name": "10010",
            "time": "2025-02-17 07:33:43",
            "value": 8.86
        },
        {
            "name": "10010",
            "time": "2025-02-17 00:40:01",
            "value": -7.63
        },
        {
            "name": "10010",
            "time": "2025-02-17 08:53:25",
            "value": 0.59
        },
        {
            "name": "10010",
            "time": "2025-02-17 18:42:04",
            "value": -3.96
        },
        {
            "name": "10010",
            "time": "2025-02-17 05:32:01",
            "value": -2.88
        },
    
    
        {
            "name": "10011",
            "time": "2025-02-17 08:24:58",
            "value": 4.6
        },
        {
            "name": "10011",
            "time": "2025-02-17 07:04:33",
            "value": 8.43
        },
        {
            "name": "10011",
            "time": "2025-02-17 03:20:37",
            "value": 10.29
        },
        {
            "name": "10011",
            "time": "2025-02-17 08:23:41",
            "value": -4.32
        },
        {
            "name": "10011",
            "time": "2025-02-17 11:56:56",
            "value": 10.54
        },
        {
            "name": "10011",
            "time": "2025-02-17 07:33:43",
            "value": 12.86
        },
        {
            "name": "10011",
            "time": "2025-02-17 00:40:01",
            "value": -7.63
        },
        {
            "name": "10011",
            "time": "2025-02-17 08:53:25",
            "value": 5.9
        },
        {
            "name": "10011",
            "time": "2025-02-17 18:42:04",
            "value": 3.96
        },
        {
            "name": "10011",
            "time": "2025-02-17 05:32:01",
            "value": 2.88
        }
    
]

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

chart
  .data(data)
  .encode('x', 'time')
  .encode('y', 'value')
  .encode('color', 'name').slider('x', {});

chart.line().encode('shape', 'smooth');

chart.point().encode('shape', 'point').tooltip(false);

chart.render();

Image

Reproduction link / 复现链接

No response

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

No response

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@chenaaaa1111 chenaaaa1111 added the waiting for maintainer Triage or intervention needed from a maintainer label Feb 17, 2025
@interstellarmt
Copy link
Contributor

多个标记存在的时候,视图里的slider配置没有传递给下层
先试试配置在标记层次:

chart.interval().slider('x', {}).slider('y', {});

@interstellarmt interstellarmt added waiting for author Further information is requested from the author and removed waiting for maintainer Triage or intervention needed from a maintainer labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Further information is requested from the author
Projects
None yet
Development

No branches or pull requests

2 participants