javascript - I want to refresh div tag onclick of image using angularjs -
i not able refresh piechart div on click of image using angularjs
div
containing image:
<div class="col-md-3 col-sm-12 col-xs-12"> <div class="panel panel-primary text-center no-boder blue"> <div class="panel-left pull-left blue"> <i class="fa fa fa-comments fa-5x"></i> </div> <div class="panel-right"> <h3>assessment</h3> </div> <img src="assets/images/refresh.png" ng-click="refreshchart()"/> </div> </div>
div want refresh:
<div class="col-xs-6 col-md-3"> <div class="panel panel-default"> <div class="panel-body easypiechart-panel"> **<div class="easypiechart" id="easypiechart-blue" data-percent="82"><span class="percent">82%</span>** </div> </div> </div> </div>
app.js code
var sampleapp1 = angular.module('sampleapp1', []); sampleapp1.controller('dashctrl', function($scope) { $scope.refreshchart = function (){ $('.chart').data('#easypiechart-blue').update(40); };
});
create method on controller (angularjs) , use redraw(reset data , update chart) $('.chart').data('easypiechart').update(40);
.
$scope.refreshchart = function (){ $('.chart').data('newchartdata').update(40); }
and in html
<img src="assets/images/refresh.png" data-ng-click="refreshchart()"/>
the best option little detection work on , see case have on first page. button refresh pie charts (https://rendro.github.io/easy-pie-chart/)
Comments
Post a Comment