<BarChart
isAnimationActive={false}
width={400}
height={200}
data={value}
margin={{
top: 5, right: 30, left: 20,
}}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="x"
/>
<YAxis label={{ value: `no.`, angle: -90, position: 'insideBottomLeft' }} />
<Tooltip
content={<CustomTooltip />}
/>
<Bar dataKey="y" /* fill={colors[0]} */ >
</BarChart>
我在x轴上的数据为数值[0,1,2,3 ...],但我希望我的刻度为[A1,A2,A3 ...]
您可以使用formatter属性,这是一个示例
<XAxis dataKey="x" tickFormatter={(t) => `A${t+1}`} />
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句