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

坐标轴精度显示问题 #3731

Closed
1 task
xingduo opened this issue Nov 30, 2021 · 1 comment
Closed
1 task

坐标轴精度显示问题 #3731

xingduo opened this issue Nov 30, 2021 · 1 comment
Assignees

Comments

@xingduo
Copy link

xingduo commented Nov 30, 2021

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

坐标轴显示精度保留了是几位数的精度,但这应该并不是我们预期的效果,请问这个问题该如何解决?
坐标配置如下:
const battery = new Chart({
container: 'Battery',
width: 1328,
height: 400,
});
battery.data(this.ctempData)
battery.scale({
time: {
tickCount: 20
},
ctemp: {
// nice: true,
tickCount: 12
}
});
battery.axis('ctemp',
{
line:{
},
tickLine:{
},
title:{
text:'温度'
},
grid:null

        }
    )

效果图如下:
image
实际的坐标数据如下:
image

Environment Info
g2 4.1.34
System -
Browser -
@rainy-25Ghz
Copy link
Contributor

rainy-25Ghz commented Jan 10, 2022

试试tickInterval:0.1调整刻度间距,或者自定义刻度格式

formatter:(val)=>`${Number.parseFloat(val).toFixed(1)}`

tickInterval示例代码

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

2 participants