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.


                <script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<div id="chartdiv"></div>


                @import url("");

body {
  font-family: "PT Sans Narrow";
#chartdiv {
  width: 100%;
  height: 98vh;



 * --------------------------------------------------------
 * This demo was created using amCharts V4 preview release.
 * V4 is the latest installement in amCharts data viz
 * library family, to be released in the first half of
 * 2018.
 * For more information and documentation visit:
 * --------------------------------------------------------

// Set theme

// Create chart instance
var chart = am4core.create("chartdiv", am4charts.PieChart);

// Let's cut a hole in our Pie chart the size of 40% the radius
chart.innerRadius = am4core.percent(40);

// Add data = [
    country: "Lithuania",
    litres: 501.9,
    bottles: 1500
    country: "Czech Republic",
    litres: 301.9,
    bottles: 990
    country: "Ireland",
    litres: 201.1,
    bottles: 785
    country: "Germany",
    litres: 165.8,
    bottles: 255
    country: "Australia",
    litres: 139.9,
    bottles: 452
    country: "Austria",
    litres: 128.3,
    bottles: 332
    country: "UK",
    litres: 99,
    bottles: 150
    country: "Belgium",
    litres: 60,
    bottles: 178
    country: "The Netherlands",
    litres: 50,
    bottles: 50

// Add and configure Series
var pieSeries = chart.series.push(new am4charts.PieSeries());
pieSeries.dataFields.value = "litres";
pieSeries.dataFields.category = "country";
pieSeries.slices.template.stroke = am4core.color("#fff");
pieSeries.slices.template.strokeWidth = 2;
pieSeries.slices.template.strokeOpacity = 1;
pieSeries.colors.step = 2;

// Disabling labels and ticks on inner circle
pieSeries.labels.template.disabled = true;
pieSeries.ticks.template.disabled = true;

// Add second series
var pieSeries2 = chart.series.push(new am4charts.PieSeries());
pieSeries2.dataFields.value = "bottles";
pieSeries2.dataFields.category = "country";
pieSeries2.slices.template.stroke = am4core.color("#fff");
pieSeries2.slices.template.strokeWidth = 2;
pieSeries2.slices.template.strokeOpacity = 1;