我想改变线图和饼图中图例和标签的字体,我该怎么做?
我几乎尝试了所有方法,但很遗憾没有起作用。
我尝试了以下方法:
<Pie
data={state}
defaultValue={resources.length + other}
plugins={{
//@ts-ignore
font: {
weight: 'bold',
size: 100,
family: 'IranYekanFa',
}
}}
options={{
title: {
display: true,
text: "",
fontColor: 'rgb(160,0,255)',
fontSize: 30,
fontFamily:"IranYekanFa",
},
legend: {
labels: {
fontFamily:"IranYekanFa !important" ,
}
},
animation: {
duration: 0, // general animation time
},
}}
/>
甚至尝试使用 CSS:
.piechart-parent-div{
font-family:"IranYekanFa" !important;
}
什么都没用!