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

🧐[问题]V2.x中,当折线图Y轴数据全是0,0轴会显示在中间,期望0轴能显示在最底部 #2483

Open
yaoyw0727 opened this issue Apr 2, 2024 · 0 comments

Comments

@yaoyw0727
Copy link

🧐 问题描述 [详细地描述问题,让大家都能理解]

V2.x中,折线图,当Y轴数据全是0的话,0轴居中显示了,期望能显示在最下方。
官方文档中并没有找到相关的配置:
image

💻 示例代码 [如果有必要,展示代码,线上示例,或仓库]

V2.x 图表示例--> 基础折线图,把data的value全部改成0,即可复现该问题。
const DemoLine = () => {
const data = [
{ year: '1991', value: 0},
{ year: '1992', value: 0},
{ year: '1993', value: 0 },
{ year: '1994', value: 0},
{ year: '1995', value: 0 },
{ year: '1996', value: 0},
{ year: '1997', value: 0},
{ year: '1998', value: 0},
{ year: '1999', value: 0 },
];
const config = {
data,
xField: 'year',
yField: 'value',
point: {
shapeField: 'square',
sizeField: 4,
},
interaction: {
tooltip: {
marker: false,
},
},
style: {
lineWidth: 2,
},
axis: {
y: {
min: 0,
minLimit: 0
}
},
};
return <Line {...config} />;
};

🚑 其他信息 [如截图等其他信息可以贴在这里]

在V1.x中,Y轴时显示在最底部的,时期望达到的效果:
image

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

1 participant