We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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展示,整个折线趋势正常展示,而不是后面的数值少的展示的比前面数值多的高
The text was updated successfully, but these errors were encountered:
data: score 用 number 类型
Sorry, something went wrong.
Damn it, searched for a long while...
No branches or pull requests
🐛 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展示,整个折线趋势正常展示,而不是后面的数值少的展示的比前面数值多的高
💻 复现代码 [提供可复现的代码,仓库,或线上示例]
© 版本信息
🚑 其他信息 [如截图等其他信息可以贴在这里]
The text was updated successfully, but these errors were encountered: