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>
<div id="chartdiv"></div>


                body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

#chartdiv {
  width: 100%;
  height: 400px;



 * ---------------------------------------
 * This demo was created using amCharts 4.
 * For more information visit:
 * Documentation is available at:
 * ---------------------------------------

// Let's use animated

// Let's create a very basic Container
var container = am4core.create("chartdiv", am4core.Container);
container.width = am4core.percent(100);
container.height = am4core.percent(100);
container.background.opacity = 1;
container.background.fill = am4core.color("#dadada");
container.background.fillOpacity = 0.5;

// Now let's create a circle in our container
var circle = container.createChild(am4core.Circle);
circle.radius = 50;
// let's put it in the middle. You can set x and y coordinates both as percent or as pixels. 
circle.x = am4core.percent(50);
circle.y = am4core.percent(50);
circle.fill = am4core.color("#6794dc");

// Make it draggable with a mouse or with touch
circle.draggable = true;

// And, for the hell of it, make it inert, so that
// when we drag it and release it will continue in
// the same direction gradually slowing down.
circle.inert = true;

// create hover state
var hoverState = circle.states.create("hover");
// you can change any property on hover
// change color = am4core.color("#dc67ce");
// make it bigger by 10% = 1.1;

// set tooltip text
circle.tooltipText = "Click me!";

// add click (hit) listener"hit", ()=>{
  // animate x to some random place
  circle.animate({property:"x", to:Math.random() * container.pixelWidth}, 2000, am4core.ease.elasticOut);

// Enable export menu = new am4core.ExportMenu();