antvis/G2

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

chenaaaa1111 posted onGitHub

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

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 / 其他

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

chart.interval().slider('x', {}).slider('y', {});
posted by interstellarmt 2 months ago

⚠️ This issue has been automatically closed due to inactivity.

  • If the issue is still relevant and important to you, feel free to:
    1. Reopen with additional information
    2. Create a new issue with updated context
    3. Reference any related issues or discussions

We close inactive issues to keep our backlog manageable and focused on active issues.

Your contribution makes our project better! 🌟


⚠️ 由于长期无活动,此 issue 已被自动关闭。

  • 如果这个问题对您来说仍然重要,您可以:
    1. 重新打开并提供补充信息
    2. 创建一个新的 issue 并更新相关背景
    3. 关联相关的 issue 或讨论

为了更好地维护项目,我们需要定期清理不活跃的问题。

感谢您为开源添砖加瓦!🌟

posted by github-actions[bot] about 2 months ago

Fund this Issue

$0.00
Funded

Pull requests