import React from "react";
import {
Chart
} from "bizcharts@3.5.8";
class Basic extends React.Component {
render() {
const cols = {
value: {
min: 0,
range:[0,0.93],
alias:'次'
},
year: {
range: [0, 0.9],
alias:'时间'
}
};
return (
<div>
<Chart height={400} data={data} scale={cols} forceFit>
<Axis name="year"
position='bottom'//top、bottom、left、right
title={{
position:'end',// position: 'start' || 'center' || 'end' 标题的位置
offset:15,//设置标题 title 距离坐标轴线的距离
textStyle: {
fontSize: '12',
textAlign: 'center',
fill: '#999',
fontWeight: 'bold',
rotate: 0,
autoRotate:true//是否需要自动旋转,默认为 true
}// 坐标轴文本属性配置
}} />
<Axis name="value" title={{
position:'end',
offset:5.5,
textStyle: {
fontSize: '12',
textAlign: 'right',
fill: '#999',
fontWeight: 'bold',
rotate: 0
}
}}/>
</Chart>
</div>
);
}
}
ReactDOM.render(<Basic />, mountNode)
bizcharts入坑问题Part2:X轴与Y轴添加单位
最新推荐文章于 2023-09-19 10:38:37 发布