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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 or require. We'll also process your JavaScript with Babel.

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


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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

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.

              <script src=""></script>
<script src=""></script>
<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: 250px;

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

// Create map instance
var chart = am4core.create("chartdiv", am4maps.MapChart);
chart.homeZoomLevel = 2;
// Set map definition
chart.geodata = am4geodata_usaLow;

// Set projection
chart.projection = new am4maps.projections.AlbersUsa();

// Create map polygon series
var polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());

// Make map load polygon (like country names) data from GeoJSON
polygonSeries.useGeodata = true;

// Configure series
var polygonTemplate = polygonSeries.mapPolygons.template;
polygonTemplate.fill = am4core.color("#74B266");
polygonTemplate.fillOpacity = 0.5;

// Create image series
var imageSeries = chart.series.push(new am4maps.MapImageSeries());
imageSeries.dataFields.value = "population";

// Create a circle image in image series template so it gets replicated to all new images
var imageSeriesTemplate = imageSeries.mapImages.template;
var circle = imageSeriesTemplate.createChild(am4core.Circle);
circle.radius = 4;
circle.fill = am4core.color("#B27799");
circle.fillOpacity = 0.7;
circle.stroke = am4core.color("#FFFFFF");
circle.strokeWidth = 2;
circle.strokeOpacity = 0.7;
circle.nonScaling = true;
circle.tooltipText = "{title}";

// Set property fields
imageSeriesTemplate.propertyFields.latitude = "latitude";
imageSeriesTemplate.propertyFields.longitude = "longitude";

// Enable OverlapBuster / configure images
imageSeriesTemplate.layout = "absolute";
imageSeriesTemplate.isMeasured = true;
var overlap = chart.plugins.push(new am4plugins_overlapBuster.OverlapBuster());

// Set heat rules
  target: circle,
  min: 10,
  max: 25,
  property: "radius"

// Add data for the three cities = [{
  "latitude": 34.0522342,
  "longitude": -118.2436849,
  "title": "Los Angeles",
  "population": 3884307
}, {
  "latitude": 32.715738,
  "longitude": -117.1610838,
  "title": "San Diego",
  "population": 1355896
}, {
  "latitude": 37.3382082,
  "longitude": -121.8863286,
  "title": "San Jose",
  "population": 998537
}, {
  "latitude": 37.7749295,
  "longitude": -122.4194155,
  "title": "San Francisco",
  "population": 837442
}, {
  "latitude": 36.7468422,
  "longitude": -119.7725868,
  "title": "Fresno",
  "population": 509924
}, {
  "latitude": 38.5815719,
  "longitude": -121.4943996,
  "title": "Sacramento",
  "population": 479686