javascript - Chart.js Radar Chart How to Remove Outer Labels - Stack Overflow

On mobile, these labels are taking up too much valuable space. How can I remove them while keeping the l

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 badges
Add a ment  | 

2 Answers 2

Reset to default 3

Found 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745150087a4613828.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信