Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // original inputs
- chartVals = ["50","30","30","16","7"]
- // converted to 360 degs
- percentVals = [135,81,81,43,18]
- // 'runningTotal' val distances
- valDifferences = [135,270,351,433,476]
- <-- slice-- >
- <div ng-repeat="pv in valDifferences track by $index" class="slice slice-{{ $index }}">
- <-- lines within slices --->
- <div ng-repeat="n in [] | range:percentVals[$index]">
- <div degree-pv class="degree degree-{{pv}}" style="transform: rotate( -{{ pv + n }}deg )"></div>
- </div>
- </div>
- // color arrays
- $scope.selectedIndex = 0;
- $scope.colors = [
- [],
- [],
- []
- ];
- for (var i = 0; i < 3; i++) {
- $scope.colors[0].push('#556270', '#4ECDC4', '#C7F464', '#FF6B6B', '#C44D58');
- $scope.colors[1].push('#eea2a2', '#cf6cc9', '#4dd0e1', '#b465da', '#ee609c');
- $scope.colors[2].push('#F8B195', '#F67280', '#C06C84', '#6C5B7B', '#355C7D');
- };
- $scope.changeColor = function ($index) {
- $scope.selectedIndex = $index;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement