{"action":"created","issue":{"url":"https://api.github.com/repos/akveo/blur-admin/issues/32","repository_url":"https://api.github.com/repos/akveo/blur-admin","labels_url":"https://api.github.com/repos/akveo/blur-admin/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/akveo/blur-admin/issues/32/comments","events_url":"https://api.github.com/repos/akveo/blur-admin/issues/32/events","html_url":"https://github.com/akveo/blur-admin/issues/32","id":155174845,"number":32,"title":"Dashboard PieGraph- percentage does not autofill on pageload","user":{"login":"yarnball","id":13043067,"avatar_url":"https://avatars.githubusercontent.com/u/13043067?v=3","gravatar_id":"","url":"https://api.github.com/users/yarnball","html_url":"https://github.com/yarnball","followers_url":"https://api.github.com/users/yarnball/followers","following_url":"https://api.github.com/users/yarnball/following{/other_user}","gists_url":"https://api.github.com/users/yarnball/gists{/gist_id}","starred_url":"https://api.github.com/users/yarnball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarnball/subscriptions","organizations_url":"https://api.github.com/users/yarnball/orgs","repos_url":"https://api.github.com/users/yarnball/repos","events_url":"https://api.github.com/users/yarnball/events{/privacy}","received_events_url":"https://api.github.com/users/yarnball/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-17T04:30:57Z","updated_at":"2016-05-19T13:55:58Z","closed_at":null,"body":"Hi,\r\n\r\nFirstly incredible work. Seriously!\r\n\r\nHowever- the percentages for the Dashboard pie charts (the first element) does not display when the page first loads. If I re-fresh the page- the percentages load. Also, if I'm using my localhost server (to access my API) then it works.\r\n\r\nThis happens in all browsers/devices I've tested.\r\n\r\nPossibly the call is missing on page load?\r\n\r\nI'm using the data-percent as the directive to get the percentage to display (line 5 of dashboardPieChart.html)\r\n\r\n`<div class=\"chart\" rel=\"{{ ::chart.color }}\" data-percent=\"{{ ::chart.percent }}\"> <span class=\"percent\"></span> </div>`\r\n\r\n\r\nMy \"DashboardPieChartCtrl.js\"  looks like this. I presume the problem is caused by the `onStep`:\r\n\r\n```\r\nfunction DashboardPieChartCtrl($scope, $log, pieApi, $timeout, $element, baUtil, baConfig, $window) {\r\n    var pieColor = baUtil.hexToRGB(baConfig.colors.defaultText, 0.2);\r\n    pieApi.getApiData()\r\n            .then(function (result) {\r\n                console.log('Piechart data',result.data);\r\n                $scope.charts = result.data;\r\n            })\r\n            .catch(function (err) {\r\n                $log.error(err);\r\n            });\r\n\r\n    function loadPieCharts() {\r\n      $('.chart').each(function () {\r\n        var chart = $(this);\r\n        chart.easyPieChart({\r\n          easing: 'easeOutBounce',\r\n          onStep: function (from, to, percent) {\r\n            $(this.el).find('.percent').text(Math.round(percent));\r\n          },\r\n          barColor: chart.attr('rel'),\r\n          trackColor: 'rgba(0,0,0,0)',\r\n          size: 84,\r\n          scaleLength: 0,\r\n          animation: 2000,\r\n          lineWidth: 9,\r\n          lineCap: 'round',\r\n        });\r\n      });\r\n    }\r\n\r\n    $timeout(function () {\r\n      loadPieCharts();\r\n    }, 1000);\r\n  };\r\n```"},"comment":{"url":"https://api.github.com/repos/akveo/blur-admin/issues/comments/220331507","html_url":"https://github.com/akveo/blur-admin/issues/32#issuecomment-220331507","issue_url":"https://api.github.com/repos/akveo/blur-admin/issues/32","id":220331507,"user":{"login":"KostyaDanovsky","id":773632,"avatar_url":"https://avatars.githubusercontent.com/u/773632?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaDanovsky","html_url":"https://github.com/KostyaDanovsky","followers_url":"https://api.github.com/users/KostyaDanovsky/followers","following_url":"https://api.github.com/users/KostyaDanovsky/following{/other_user}","gists_url":"https://api.github.com/users/KostyaDanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaDanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaDanovsky/subscriptions","organizations_url":"https://api.github.com/users/KostyaDanovsky/orgs","repos_url":"https://api.github.com/users/KostyaDanovsky/repos","events_url":"https://api.github.com/users/KostyaDanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaDanovsky/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T13:55:58Z","updated_at":"2016-05-19T13:55:58Z","body":"@yarnball, thanks for posting issue\r\nfixed in https://github.com/akveo/blur-admin/commit/9b2840c1f4addeec642293d2b654df9b81c4ee73"}}