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

Scrollbar not work, when color encode is equal to x encode #4012

Closed
1 task done
lyz810 opened this issue Jun 28, 2022 · 2 comments
Closed
1 task done

Scrollbar not work, when color encode is equal to x encode #4012

lyz810 opened this issue Jun 28, 2022 · 2 comments

Comments

@lyz810
Copy link

lyz810 commented Jun 28, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

同时设置color和scrollbar,会导致图标渲染异常,如上述链接所示。

Setting both color and scrollbar, will cause chart render uncorrect, as the link above.
image

Environment Info
g2 4.2.4
System -
Browser -
import { Chart } from "@antv/g2";

const data = Array.from({ length: 50 }, (_, index) => ({
  title: `选项 ${index + 1}`,
  value: 100 * (index + 1)
}));

const chart = new Chart({
  container: "root",
  height: 300,
  autoFit: true
});

// 这里只要设置了color和滚动条就会渲染错误
chart.interval().position("title*value").color("title");

chart.option("scrollbar", {
  type: "horizontal"
});

chart.data(data);
chart.render();

期望设置颜色的同时,也可以正确显示滚动条

Expect color and scrollbar can be set at the same time
image

@visiky
Copy link
Member

visiky commented Jun 29, 2022

1、color 通道和 x 通道的字段一致,会导致 scrollbar(对 x 通道数据的过滤)失效(目前这个问题是已知的,暂时比较难解决)
2、G2 5.0 会解决这个问题

@visiky visiky changed the title Chart render not correct Scrollbar not work, when color encode is equal to x encode Jun 29, 2022
@jxguoguo
Copy link

我做这个需求也遇到,原来是这样,希望大佬早点更新

@antvis antvis locked and limited conversation to collaborators May 10, 2023
@hustcc hustcc converted this issue into discussion #4992 May 10, 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

3 participants