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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <svg version="1.1"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
	 x="0px" y="0px" width="724px" height="400px"
	 overflow="visible" xml:space="preserve">
    <g id="circleBarCharts">
        <!-- Web Circle Bar Chart -->
        <g id="circleBar-web-group" transform="translate(0,0)">
          <image id="circleBar-web-icon" opacity="0" x="166" y="112" overflow="visible" width="98" height="77" xlink:href="http://www.frank-designs.com/images/icon_web.png" />
            <text id="circleBar-web-text" opacity="0" x="200" y="143">WEB</text>
            <g id="circleBar-web-chart" transform="translate(215,150)"></g>
            <clippath id="circleBar-web-clipPath">
                <rect id="circleBar-web-clipLabels" x="205" y="215" width="180" height="0"></rect>
            <g id="circleBar-web-legend" clip-path="url(#circleBar-web-clipPath)">
                <text id="circleBar-web-values" transform="translate(222,225)"></text>
                <text id="circleBar-web-labels" transform="translate(277,225)"></text>
        <!-- END: Web Circle Bar Chart -->
        <!-- Mobile Circle Bar Chart -->
        <g id="circleBar-mobile-group" transform="translate(362,0)">
            <image id="circleBar-mobile-icon" opacity="0" x="195" y="112" overflow="visible" width="40" height="77" xlink:href="http://www.frank-designs.com/images/icon_mobile.png" />
            <text id="circleBar-mobile-text" opacity="0" x="187" y="155">MOBILE</text>
            <g id="circleBar-mobile-chart" transform="translate(215,150)"></g>
            <clippath id="circleBar-mobile-clipPath">
                <rect id="circleBar-mobile-clipLabels" x="205" y="215" width="150" height="0"></rect>
            <g id="circleBar-mobile-legend" clip-path="url(#circleBar-mobile-clipPath)">
                <text id="circleBar-mobile-values" transform="translate(222,225)"></text>
                <text id="circleBar-mobile-labels" transform="translate(277,225)"></text>
        <!-- END: Mobile Circle Bar Chart -->
              body {
    position: relative;
    font-family: 'FranklinGothic-Book' "Franklin Gothic Medium", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif;
#circleBar-web-labels tspan,
#circleBar-mobile-labels tspan {
    font-family: 'FranklinGothic-Book' "Franklin Gothic Medium", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif;

#circleBar-web-values tspan,
#circleBar-mobile-values tspan {
    font-family: 'FranklinGothic-Book' "Franklin Gothic Medium", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif;
    font-size: 9px;
#circleBar-web-values tspan {
    fill: #7D3A4D;
#circleBar-mobile-values tspan {
    fill: #684E88;
              var chartData = {
        {"index":0.3, "value":17436920, "fill":"#231F20", "label":"WebMd Health"},
        {"index":0.4, "value":10884799, "fill":"#494551", "label":"Livestrong.com"},
        {"index":0.5, "value":10257432, "fill":"#564965", "label":"Everyday Health"},
        {"index":0.6, "value":6110024,  "fill":"#574270", "label":"About.com"},
        {"index":0.7, "value":3895612,  "fill":"#4D2D77", "label":"Drugs.com"},
        {"index":0.8, "value":3414585,  "fill":"#684E88", "label":"Alliance Health"},
        {"index":0.9, "value":3099372,  "fill":"#846F9D", "label":"Lifescript.com"},
        {"index":1,   "value":2897520,  "fill":"#A494B7", "label":"Health.com"},
        {"index":1.1, "value":2772679,  "fill":"#CBC3D6", "label":"Health Grades"},
        {"index":1.2, "value":2636126,  "fill":"#F1EFF4", "label":"Healthline"}
        {"index":0.3, "value":31588490, "fill":"#231F20", "label":"WebMD Health"},
        {"index":0.4, "value":26260662, "fill":"#403437", "label":"Everyday Health"},
        {"index":0.5, "value":24263463, "fill":"#53363C", "label":"Livestrong.com"},
        {"index":0.6, "value":12795112, "fill":"#5E2C3A", "label":"About.com Health Section"},
        {"index":0.7, "value":11959167, "fill":"#660E34", "label":"Healthline"},
        {"index":0.8, "value":10408917, "fill":"#7D3A4D", "label":"HealthGrades"},
        {"index":0.9, "value":10317462, "fill":"#96606B", "label":"Yahoo! Health"},
        {"index":1,   "value":9765589,  "fill":"#B28A91", "label":"Lifescript.com"},
        {"index":1.1, "value":7734964,  "fill":"#D3BCBF", "label":"Health.com"},
        {"index":1.2, "value":7504000 , "fill":"#EDE4E5", "label":"Drugs.com"}

function drawBarCircleChart(data,target,values,labels){
    var w = 362,
        h = 362,
        size = data[0].value * 1.15,
        radius = 200,
        sectorWidth = .1,
        radScale = 25,
        sectorScale = 1.45,
        target = d3.select(target),
        valueText = d3.select(values),
        labelText = d3.select(labels);

    var arc = d3.svg.arc()
        .innerRadius(function(d,i){return (d.index/sectorScale) * radius + radScale; })
        .outerRadius(function(d,i){return ((d.index/sectorScale) + (sectorWidth/sectorScale)) * radius + radScale; })
        .endAngle(function(d) { return Math.PI + (d.value / size) * 2 * Math.PI; });
    var path = target.selectAll("path")

    //TODO: seperate color and index from data object, make it a pain to update object order
        .attr("fill",function(d,i){return d.fill})
        .delay(function(d,i){return i*100})
        .attrTween("d", arcTween);
            y:function(d,i){return i*14},       
        .text(function(d,i){return data[i].value});
            y:function(d,i){return i*14}
        .text(function(d,i){return data[i].label});

    function arcTween(b) {
        var i = d3.interpolate({value: 0}, b);
        return function(t) {
            return arc(i(t));

// Animation Queue



🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.