Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将jQuery与AngularJS结合使用_Jquery_Angularjs_Raphael_Graphael - Fatal编程技术网

如何将jQuery与AngularJS结合使用

如何将jQuery与AngularJS结合使用,jquery,angularjs,raphael,graphael,Jquery,Angularjs,Raphael,Graphael,我尝试在angularjs web应用程序上使用raphael库和jquery实现饼图。有什么捷径可以做到这一点吗 在注释中,您需要修改工作代码 谢谢您的回答。您可以使用指示性awesomechart <awesomechart type="pie" id='chart2' width="400" height="400" data="data"> </awesomechart> 这是一条导电线: myapp.directive('rafaelPie',

我尝试在angularjs web应用程序上使用raphael库和jquery实现饼图。有什么捷径可以做到这一点吗

在注释中,您需要修改工作代码


谢谢您的回答。

您可以使用指示性awesomechart

 <awesomechart type="pie" id='chart2' width="400" height="400" data="data">
    </awesomechart>


    • 这是一条导电线:

      myapp.directive('rafaelPie',
      '$q',
      function ($compile, $q) {
        'use strict';
        return {
          restrict: 'A',
          scope: {
            values:"=values",
            width:"@width",
            height:"@height",
            labels:"=labels"
          },
      
          link: function postLink(scope, element, attr, ctrl) {
          /*Create first pie raphael*/        
          var pie = Raphael(element[0], scope.width, scope.height).pieChart(350, 350, 200, values, labels, "#fff");  
          /*Wath value */
          scope.$watch(scope.values, function (newValue, oldValue) {
                  pie.updateyourvalue();
                });
          scope.$watch(scope.label, function (newValue, oldValue) {
                  pie.updateyourvalue();
                });
          }
        };
      }
      
      以你的角度来看

      <div id="holder" rafael-pie width="700" height="700" ></div>
      

      你有没有类似可视化的例子……就像在我的小提琴里,但没有拉斐尔的右库,否则看起来不错……谢谢