Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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>


                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: 95vh;


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

// Create root element
var root ="chartdiv");

// Set themes

// Create chart
var chart = root.container.children.push(, {
  panX: true,
  panY: true,
  wheelX: "panX",
  wheelY: "zoomX",
  pinchZoomX: true

// Add cursor
var cursor = chart.set("cursor",, {}));
cursor.lineY.set("visible", false);

// Create axes
var xRenderer =, {
  minGridDistance: 30

var xAxis = chart.xAxes.push(, {
  maxDeviation: 0.3,
  categoryField: "country",
  renderer: xRenderer,
  tooltip:, {})

// Enable label wrapping
  oversizedBehavior: "wrap",
  textAlign: "center"

// Set up automatic width calculation using an adapter
xRenderer.labels.template.adapters.add("width", function(width, target) {
  var x0 = xAxis.getDataItemCoordinateY(xAxis.dataItems[0], "category", 0);
  var x1 = xAxis.getDataItemCoordinateY(xAxis.dataItems[0], "category", 1);
  target.set("maxWidth", x1 - x0)
  return x1 - x0;

var yAxis = chart.yAxes.push(, {
  maxDeviation: 0.3,
  renderer:, {})

// Create series
var series = chart.series.push(, {
  name: "Series 1",
  xAxis: xAxis,
  yAxis: yAxis,
  valueYField: "value",
  sequencedInterpolation: true,
  categoryXField: "country",
  tooltip:, {
    labelText: "{valueY}"

// Set data
var data = [{
  country: "Long name number one...",
  countryFull: "Long name number one Long name number one Long name number one Long name number one Long name number one Long name number one",
  value: 2025
}, {
  country: "Long name number two",
  value: 1882
}, {
  country: "Long name number three",
  value: 1809
}, {
  country: "Long name number four",
  value: 1322
}, {
  country: "Long name number five",
  value: 1122
}, {
  country: "Long name number six",
  value: 1114
}, {
  country: "Long name number seven",
  value: 984
}, {
  country: "Long name number eight",
  value: 711
}, {
  country: "Long name number nine",
  value: 665

 tooltipText:"a {countryFull}",

// Make stuff animate on load
chart.appear(1000, 100);