How to vary the thickness of doughnut chart, using ChartJs.?

前端 未结 4 2059
独厮守ぢ
独厮守ぢ 2020-12-18 18:29

How to vary the thickness of doughnut chart, using ChartJs

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-18 18:53

    If you are using chart.js for Angular via ng2-charts you would do something like this in your component.html file:

    // component.html file
    
    
    
    
    // Do note that other required directives are missing in this example, but that I chose to highlight the 'options' directive
    
    

    And do something like this in your component.ts file:

    //component.ts file
    
    chartOptions = {
      cutoutPercentage: 80
    };
    
    

    A helpful source of information: available chart directives and config options for the [options] directive

提交回复
热议问题