如何将jQuery与AngularJS结合使用
我尝试在angularjs web应用程序上使用raphael库和jquery实现饼图。有什么捷径可以做到这一点吗 在注释中,您需要修改工作代码如何将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',
谢谢您的回答。您可以使用指示性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>
你有没有类似可视化的例子……就像在我的小提琴里,但没有拉斐尔的右库,否则看起来不错……谢谢