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

🐛[BUG]yAxis里面的设置参数没有生效 #70

Closed
zhu-ml opened this issue Jun 10, 2020 · 2 comments
Closed

🐛[BUG]yAxis里面的设置参数没有生效 #70

zhu-ml opened this issue Jun 10, 2020 · 2 comments

Comments

@zhu-ml
Copy link

zhu-ml commented Jun 10, 2020

🐛 bug 描述 [详细地描述 bug,让大家都能理解]

yAxis: {
min: 0,
max: 100,
tickCount: 5,
tickInterval: 20
}
想设置纵轴的刻度单位,但是没有生效
且不论设不设置yAxis,折线图的点趋势展示都不正确

📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]

import React, { useMemo } from 'react';
import { Line } from '@ant-design/charts';

export type MonthlyTrendProps = {
lineProps?: any;
};

const MonthlyTrend: React.FC = props => {

const data = [
{month: 'Jan', score: '20'},
{month: 'Feb', score: '50'},
{month: 'Mar', score: '80'},
{month: 'Apr', score: '70'},
{month: 'May', score: '60'},
{month: 'Jun', score: '40'},
{month: 'Jul', score: '20'},
{month: 'Aug', score: '30'},
{month: 'Sep', score: '40'},
{month: 'Oct', score: '60'},
{month: 'Nov', score: '80'},
{month: 'Dec', score: '90'}
]

const config = useMemo(() => {
return {
data: data,
title: {
visible: true,
text: 'test'
},
xField: 'month',
yField: 'score',
point: {
visible: true,
},
color: '#FA8C16',
yAxis: {
min: 0,
max: 100,
tickCount: 5,
tickInterval: 20
}
}
}, [data])

return <Line {...config} />;
};

export default MonthlyTrend;

🏞 期望结果 [描述你原本期望看到的结果]

Y轴的刻度从0-100,间隔为20展示,整个折线趋势正常展示,而不是后面的数值少的展示的比前面数值多的高

💻 复现代码 [提供可复现的代码,仓库,或线上示例]

© 版本信息

  • ant-design-charts 版本: [0.9.4]
  • 浏览器环境[Chrome]
  • 开发环境 [win10]

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

@zhu-ml zhu-ml changed the title yAxis里面的设置参数没有生效🐛[BUG] 🐛[BUG]yAxis里面的设置参数没有生效 Jun 10, 2020
@lxfu1
Copy link
Member

lxfu1 commented Jun 10, 2020

data: score 用 number 类型

@lgxZJ
Copy link

lgxZJ commented Jul 4, 2020

data: score 用 number 类型

Damn it, searched for a long while...

@zhu-ml zhu-ml closed this as completed Jul 6, 2020
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