我无法在chart.js中尝试显示字体真棒字符作为标签
1。我添加了fontawesome的CSS
2。我从https://fontawesome.com/cheatsheet
设置了字符 3。我编辑了chart.js选项,将pointLabels.fontFamily
设置为FontAwesome
,但是它从不加载unicode,而emoji表情却加载了(Unicode)。
var ctx = document.getElementById("myChart").getContext('2d');
var myRadarChart = new Chart(ctx, {
type: 'radar',
data: {
labels: ['', '', "\uf461", '\uf368', '\uf558'],
datasets: [{
data: [20, 10, 4, 2,1]
}]
},
options: {
scale: {
pointLabels: {
fontFamily: "FontAwesome",
}
}
}
});
完整代码: http://jsfiddle.net/vm9o6bfs/2/
我想念什么?
答案 0 :(得分:0)