请帮帮我.如何将标签更改为 bar chart.js 中的图像(图标)?我的意思是,从这里改变
Help me, please. How to change the labels to the image (icon) in bar chart.js ? I mean, change from this change labels: "LifeWall_files/logo.png","Bodily Functions","Sleep"
to this bottom icons
解决方案The easiest way to do this would be to get a font that includes these icons and then set the font family for the ticks
...
options: {
scales: {
xAxes: [{
ticks: {
fontFamily: 'FontAwesome'
}
}]
}
}
};
and then specify the appropriate character codes in your labels
labels: ["uf24e", "uf1b9", "uf242", "uf0fc", "uf236"],
With the FontAwesome CSS, the above would give you
上一篇:C#中如何正确处置的SmtpClient的?如何正确、SmtpClient
下一篇:ElapsedTicks,ElapsedMilliseconds,Elapsed.Milliseconds和Elapsed.TotalMilliseconds之间的区别? (C#)区别、Elapsed