Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. // original inputs
  2. chartVals = ["50","30","30","16","7"]
  3.  
  4. // converted to 360 degs
  5. percentVals = [135,81,81,43,18]
  6.  
  7. // 'runningTotal' val distances
  8. valDifferences = [135,270,351,433,476]
  9.  
  10. <-- slice-- >
  11. <div ng-repeat="pv in valDifferences track by $index" class="slice slice-{{ $index }}">
  12.  
  13. <-- lines within slices --->
  14. <div ng-repeat="n in [] | range:percentVals[$index]">
  15. <div degree-pv class="degree degree-{{pv}}" style="transform: rotate( -{{ pv + n }}deg )"></div>
  16. </div>
  17. </div>
  18.  
  19. // color arrays
  20. $scope.selectedIndex = 0;
  21. $scope.colors = [
  22. [],
  23. [],
  24. []
  25. ];
  26.  
  27. for (var i = 0; i < 3; i++) {
  28. $scope.colors[0].push('#556270', '#4ECDC4', '#C7F464', '#FF6B6B', '#C44D58');
  29. $scope.colors[1].push('#eea2a2', '#cf6cc9', '#4dd0e1', '#b465da', '#ee609c');
  30. $scope.colors[2].push('#F8B195', '#F67280', '#C06C84', '#6C5B7B', '#355C7D');
  31. };
  32.  
  33. $scope.changeColor = function ($index) {
  34. $scope.selectedIndex = $index;
  35. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement