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
折线图当数据值较小的时候,例如count为1的时候,坐标轴显示小数,期望显示整数 #3574
Comments
可以设置 tickMethod 防止小数的出现: chart.scale({
tickMethod: 'd3-linear'
}) |
采用d3-linear 并没有生效,这个d3-linear 是要引入npm包吗 |
给一个复线 demo 我看看? |
demo 如下 |
设置 tickCount 为 1 就可以,因为 d3-linear 是保证在 tickCount <= max - min 的时候生成整数的 ticks。可以参考这里:https://github.com/antvis/scale/blob/master/docs/api/tick-methods.md value: {
min: 0,
nice: true,
tickMethod: "d3-linear",
tickCount: 1,
} |
|
嗯嗯,是可以的,因为 tickCount 其实可以根据 max - min 去设置。 |
What problem does this feature solve?
解决了,某些场景下不会出现小数的数据
What does the proposed API look like?
chart.scale({
minInterval: 1
})
The text was updated successfully, but these errors were encountered: