Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div ng-app="pieApp">
<div ng-controller="Ctrl" class="pie__shell">
  <canvas id="skills"></canvas>

  <button ng-click="bUp()">bump up</button>
  <button ng-click="bDn()">bump down</button>





                "use strict";

var base = 50,          // variable for base value
    other = calB(),    // call function to cook "other" value
pd = [                  // segment values 
      value: base,
      label: 'Used',
      color: '#3b5998'
      value: other,
      label: 'Unused',
      color: '#eee'
po = {                  // array for larger switches
    segmentShowStroke : false,
    segmentStrokeColor : "#fff",
    segmentStrokeWidth : 0,
    percentageInnerCutout : 90, // This is 0 for Pie charts
    animationSteps : 20,
    animationEasing : "easeIn",
    animateRotate : false,
    animateScale : false,
    onAnimationComplete: aniDone,
    showTooltips: false

// 2-step process to draw out our chart
var context = document.getElementById('skills').getContext('2d');
var skillsChart = new Chart(context).Doughnut(pd,po);

// function cooks 
function calB() {
  other = 100-base;
  return other;

function aniDone() {
  //console.log('animation complete');

angular.module('pieApp', [])
  .controller('Ctrl', function($scope) {
      $scope.updateMe = function() {
        if(base>100)  {  base = 0;  }
        if(base<0)    {  base = 100;  }
        skillsChart.segments[0].value = base;
        skillsChart.segments[1].value = other;
      $scope.bUp = function() {
        base += 10;
      $scope.bDn = function() {
        base -= 10;