admin管理员组文章数量:1414628
On mobile, these labels are taking up too much valuable space. How can I remove them while keeping the lines?
I've tried several methods, ones that seem to work for typical x/y graphs, but can't find a way to achieve this for the radar chart.
On mobile, these labels are taking up too much valuable space. How can I remove them while keeping the lines?
I've tried several methods, ones that seem to work for typical x/y graphs, but can't find a way to achieve this for the radar chart.
Share Improve this question asked Mar 8, 2017 at 18:37 blindmikeyblindmikey 1371 silver badge10 bronze badges2 Answers
Reset to default 3Found a solution! see below:
options: {
scale: {
pointLabels: {
callback: function(pointLabel, index, labels) {
return screen_w > 500 ? pointLabel : ' ';
}
}
}
}
I'm using a variable of my own screen_w
to conditionally return the label, or nothing.
Works like a charm.
Found buried here: https://github./chartjs/Chart.js/pull/1879
Found simplest solution for remove outer label for all cases
scale:{
pointLabels:{
fontSize: 0
},
}
Just make FontSize equal to zero
本文标签: javascriptChartjs Radar Chart How to Remove Outer LabelsStack Overflow
版权声明:本文标题:javascript - Chart.js Radar Chart How to Remove Outer Labels - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745150086a2644880.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论