angularjs - angular-chart.js 1.0.3 - how to show tooltips after animation completes -
i'm trying make doughnut or pie chart values on each piece or tooltips active after animation complete, this:
but couldn't make work far - other answers worked older versions of angular-chart.js. far have this(please see full page):
(function(){ angular.module('chartapp',['chart.js']) .config(['chartjsprovider', function (chartjsprovider) { // configure charts chartjsprovider.setoptions({ //custom colors chartcolors : [ '#803690', '#00adf9', '#dcdcdc', '#46bfbd', '#fdb45c', '#949fb1', '#4d5360'], responsive: true }); }]) .controller('doughnutchartcontroller', ['$scope', '$timeout',function ($scope, $timeout) { /*********************************** doughnut chart *****************/ $scope.labels = ["download sales", "in-store sales", "mail-order sales"]; $scope.data = [300, 500, 100]; $scope.colors = ["#ff6384","#36a2eb","#ffce56"]; $scope.options = { legend: { display: true, labels: { fontcolor: '#ffce56'},//yellow }, animation:{ animatescale:true, oncomplete: function(object){ //this.tooltip.initialize(); } }, title: { display: true, fontcolor: '#36a2eb',//blue text: 'custom chart title' }, tooltips: { enabled: true, //no tooltips on mose hover backgroundcolor:'#36a2eb',//blue cornerradius: 0, //no border-radius } }; }]); })();
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.3.0/chart.js"></script> <script src="https://cdn.jsdelivr.net/angular.chartjs/1.0.3/angular-chart.js"></script> <div ng-app="chartapp"> <div ng-controller="doughnutchartcontroller"> <canvas id="doughnut" class="chart chart-doughnut" chart-data="data" chart-colors="colors" chart-labels="labels" chart-options="options"> </canvas> </div> </div>
thanks time!!!
Comments
Post a Comment