作者:Mua--于毛毛在路上 | 来源:互联网 | 2023-05-18 20:11
Icreatedapiechartwithchartjs,butwhenIclickonaspecificslice,theclickeventisnottak
I created a pie chart with chartjs
, but when I click on a specific slice, the click event is not taken.
我创建了一个带有chartjs的饼图,但是当我单击特定切片时,不会执行click事件。
View:
视图:
Projects
Controller:
控制器:
'use strict';
angular.module('Progs')
.controller('ProjectsController', ['$scope', '$rootScope', '$http', '$window', '$state',
function ($scope, $rootScope, $http, $window, $state) {
//...
$scope.chartClick = function (event) {
console.log('chartClick');
//console.log("segment: " + $scope.chart.getSegmentsAtEvent(event));
}
//...
}
What's wrong with my code?
我的代码出了什么问题?
Please note: I am not using angular-chart.js
请注意:我没有使用angular-chart.js
3 个解决方案