删除Angularjs-Chart边框并减少图表弧的厚度

时间:2016-12-10 18:24:30

标签: angularjs chart.js

如何移除Angularjs圆环图的边框线并减少弧的厚度。

HTML

            <canvas id="doughnut" class="chart chart-doughnut" chart-colors="preColors" chart-dataset-override="datasetOverridePres" chart-dataset-options="preLegend" chart-data="preData" chart-labels="preName">
            </canvas>

JS

    $scope.preColors = ['#febe05','#f3f3f3'];
    $scope.preData = [343,78];

谢谢

1 个答案:

答案 0 :(得分:4)

我改变了你的代码(我认为chart-dataset-options不正确):

        <canvas id="doughnut" class="chart chart-doughnut" 
        chart-colors="preColors" 
        chart-options="preLegend" 
        chart-data="preData" 
        chart-labels="preName" 
        chart-dataset-override="preOverride">
        </canvas>

和JS:

    $scope.preColors = ['#febe05', '#f3f3f3'];
    $scope.preData = [343, 78];
    $scope.preName = ['a', 'b'];

    $scope.preLegend = { 
      cutoutPercentage: 80, //arc thickness
      elements: {
        arc: {
          borderWidth: 0 // border line
        }
      }
    }
    $scope.preOverride = [{}];

结果:

enter image description here

现场演示:SkinnyDoughnout