gpt4 book ai didi

reactjs - 重新绘制自动换行 x 轴标签

转载 作者:行者123 更新时间:2023-12-03 14:32:11 25 4
gpt4 key购买 nike

我想要像这样的长标签自动换行 demo 。据说this PR支持它,但我无法让它工作

<XAxis dataKey="name" interval={0} width={30} label={<Text width={30} />} />

最佳答案

有一个例子herelisamartin00 完成

她使用了自定义轴刻度:

const CustomizedAxisTick = React.createClass({
render () {
const {x, y, payload} = this.props;

return <Text x={x} y={y} width={75} textAnchor="middle" verticalAnchor="start">{payload.value}</Text>
}
});

关于reactjs - 重新绘制自动换行 x 轴标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46875822/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com