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

矩形树图使用scale ,type设置为log无效 #3725

Closed
curryz opened this issue Nov 25, 2021 · 6 comments
Closed

矩形树图使用scale ,type设置为log无效 #3725

curryz opened this issue Nov 25, 2021 · 6 comments
Assignees

Comments

@curryz
Copy link

curryz commented Nov 25, 2021

矩形树图最大值和最小值差的倍数很大的时候,最小值展示不出来面积。使用scale设置log,无效。有解决办法吗?

@rainy-25Ghz
Copy link
Contributor

rainy-25Ghz commented Jan 7, 2022

可以给个复现demo吗?

@curryz
Copy link
Author

curryz commented Jan 25, 2022

@rainy-25Ghz
Copy link
Contributor

rainy-25Ghz commented Jan 25, 2022

https://bizcharts.net/gist/3duH4AJMpe0

有可能是bizchart的问题
换一个g2写的复现吧

@curryz
Copy link
Author

curryz commented Feb 9, 2022

https://bizcharts.net/gist/3duH4AJMpe0

有可能是bizchart的问题 换一个g2写的复现吧

https://codesandbox.io/s/awesome-elgamal-vd67o?file=/index.ts

@curryz
Copy link
Author

curryz commented Feb 9, 2022

是因为使用方法不对吗?
看文档理解的这样用应该没有问题

@hustcc
Copy link
Member

hustcc commented Dec 6, 2022

矩形树图比较特殊的地方在于,数据是经过布局算法产生的,所以 x y 的范围都在 0 ~ 1 之间,这个区间里面的数据,使用 log 并不能区分出来。

这种情况用 pow 会能区分出来。

chart.scale({
  x: {
    nice: true,
    type: 'pow',
    exponent: 0.1, // 👈🏻 必须设置
  },
  y: {
    nice: true,
    type: 'pow',
    exponent: 0.1,
  },
});

@hustcc hustcc closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants