【问题标题】:Add Image inside an easy pie chart in angular js在角度 js 中的简单饼图中添加图像
【发布时间】:2020-07-30 15:30:43
【问题描述】:

我正在尝试在我的简单饼图中实现图像,但它不在饼图中,但我们添加的任何内容都会从圆圈/图表中显示出来。我也尝试了两个两个绑定或尝试提供 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'
            };
});

【问题讨论】:

    标签: javascript html angularjs image easypie


    【解决方案1】:

    使用它来显示百分比并使用您的 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>
    

    【讨论】:

      猜你喜欢
      • 2018-04-08
      • 2015-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多