admin管理员组文章数量:1318156
I need to change the color of the labels displayed at each point on the chart, I have tried many different things without any result at all.
Image
Code
const CHART = document.getElementById("radar_chart");
Chart.defaults.scale.ticks.beginAtZero = true;
Chart.defaults.scale.ticks.max = 10;
Chart.defaults.scale.ticks.display = false;
Chart.defaults.scale.ticks.display = false;
var radar = new Chart(CHART, {
type: 'radar',
data: {
labels: ["Team", "Potential", "Risk", "Social", "Hype"],
datasets: [
{
backgroundColor: "#2e4259cc",
borderColor: "#fff",
borderWidth: 3,
pointBorderColor: "#fff",
pointBackgroundColor: "#2e4259",
pointHoverRadius: 5,
data: [3, 5, 9, 5, 8]
}
]
},
options: {
legend: {
display: false,
fontColor: "#fff",
labels: {
fontColor: '#fff'
}
}
}
});
My latest effort was changing pointLabelFontColor but with no luck, i can't seem to find anything about it
I need to change the color of the labels displayed at each point on the chart, I have tried many different things without any result at all.
Image
Code
const CHART = document.getElementById("radar_chart");
Chart.defaults.scale.ticks.beginAtZero = true;
Chart.defaults.scale.ticks.max = 10;
Chart.defaults.scale.ticks.display = false;
Chart.defaults.scale.ticks.display = false;
var radar = new Chart(CHART, {
type: 'radar',
data: {
labels: ["Team", "Potential", "Risk", "Social", "Hype"],
datasets: [
{
backgroundColor: "#2e4259cc",
borderColor: "#fff",
borderWidth: 3,
pointBorderColor: "#fff",
pointBackgroundColor: "#2e4259",
pointHoverRadius: 5,
data: [3, 5, 9, 5, 8]
}
]
},
options: {
legend: {
display: false,
fontColor: "#fff",
labels: {
fontColor: '#fff'
}
}
}
});
My latest effort was changing pointLabelFontColor but with no luck, i can't seem to find anything about it
Share Improve this question edited Dec 3, 2019 at 21:58 ii iml0sto1 asked Apr 10, 2018 at 20:22 ii iml0sto1ii iml0sto1 1,76220 silver badges42 bronze badges2 Answers
Reset to default 7options:{
scale:{
pointLabels:{
fontColor:"red",
},
}
In theory this should be the configuration you should use if we follow the doc for the Linear Radial Axis
The doc is for the version 2.7.2, so I am not sure it would work for your version, or if it would be any different in older version.
options: {
scales: {
r: {
pointLabels:{
color: 'rgb(54, 162, 235)',
},
},
}
I don’t know what version you are using, but the current configuration works for me.
本文标签: javascriptChartjs RadarChange color of end point labelsStack Overflow
版权声明:本文标题:javascript - Chartjs Radar - Change color of end point labels - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742043645a2417662.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论