【发布时间】:2021-11-10 08:01:11
【问题描述】:
我想更改折线图和饼图中的图例和标签的字体,我该怎么做? 我几乎尝试了一切,但不幸的是没有任何效果 我尝试以下方法:
<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;
}
没用!
【问题讨论】:
标签: css reactjs typescript chart.js font-family