0

我正在尝试在我的简单饼图中实现图像,但它不在饼图中,但我们添加的任何内容都会从圆圈/图表中显示出来。我也尝试了两个两个绑定或尝试提供 ng 模型但仍然无法正常工作。

html:

 <script src="https://cdnjs.cloudflare.com/ajax/libs/easy-pie-chart/2.1.6/angular.easypiechart.js" ></script>
     <div easypiechart options="options" percent="percent" ng-model="data" ></div>
   

                            

JS:

var Application = angular.module('Ui', ['ui.bootstrap','easypiechart']);
Application.controller('global',   function($scope,$timeout,dateFilter,$interval) {

    $scope.data =1;
    $scope.percent = 65;
            $scope.options = {
                animate:{
                    duration:0,
                    enabled:false
                },
                barColor:'#2C3E50',
                scaleColor:false,
                lineWidth:2,
                lineCap:'circle'
            };
});
4

1 回答 1

0

将此用于显示百分比并使用您的 js 代码

<span
    class="chart"
    easypiechart
    ng-init="options = {animate:false,barColor:'#E67E22', scaleColor:false, lineWidth:3, lineCap:'butt' }"
    percent="percent"
    options="options"
>
    <span class="percent" ng-bind="percent"></span>
</span>
于 2021-06-08T13:38:17.473 回答