Change label font color for a line chart using Chart.js

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 01:51:25
vortexwolf

Yes, the scaleFontColor option changes the color of labels.

You probably tried to add it to the data object, that's why it didn't work. Actually it should be passed as a second parameter of the Line function like this:

var myLine = new Chart(document.getElementById("cpu-chart").getContext("2d"))
    .Line(lineChartData, { scaleFontColor: "#ff0000" });

Edit:

Similarly, to change the font size use scaleFontSize.

Example:

scaleFontSize: 16
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!