使用 recharts 网站上的示例条形图,我想将标签上的数字显示为 %。https://jsfiddle.net/gearoid/7e717fa8/1/
const data = [
{ name: "18-24", audience: 35.18 },
{ name: "25-34", audience: 21.96 },
{ name: "35-44", audience: 7.26 },
{ name: "45-54", audience: 2.19 },
{ name: "55-64", audience: 0.67 },
{ name: "65+", audience: 0.33 },
{ name: "unknown", audience: 32.41 }
];
当我尝试将 % 添加到数组时,它会显示在标签中,但不会显示栏。常量数据= [{名称:“18-24”,观众:35.18 +“%”}];`
关于如何实现这一目标的任何想法?
谢谢!