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


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";

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

#chartdiv {
  width: 450px;
  height: 600px;
  margin: 0 auto;



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

// Themes begin
// Themes end

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

// Add data = [{
  "y": "1",
  "x": 1,
  "text": "[bold]2018 Q1[/]\nThere seems to be some furry animal living in the neighborhood.",
  "center": "right"
}, {
  "y": "2",
  "x": 1,
  "text": "[bold]2018 Q2[/]\nWe're now mostly certain it's a fox.",
  "center": "left"
}, {
  "y": "3",
  "x": 1,
  "text": "[bold]2018 Q3[/]\nOur dog does not seem to mind the newcomer at all.",
  "center": "right"
}, {
  "y": "4",
  "x": 1,
  "text": "[bold]2018 Q4[/]\nThe quick brown fox jumps over the lazy dog.",
  "center": "left"

// Create axes
var yAxis = chart.yAxes.push(new am4charts.CategoryAxis());
yAxis.dataFields.category = "y";
yAxis.renderer.grid.template.disabled = true;
yAxis.renderer.labels.template.disabled = true;
yAxis.tooltip.disabled = true;

var xAxis = chart.xAxes.push(new am4charts.ValueAxis());
xAxis.min = 0;
xAxis.max = 1.99;
xAxis.renderer.grid.template.disabled = true;
xAxis.renderer.labels.template.disabled = true;
xAxis.renderer.baseGrid.disabled = true;
xAxis.tooltip.disabled = true;

// Create series
var series = chart.series.push(new am4charts.LineSeries());
series.dataFields.categoryY = "y";
series.dataFields.valueX = "x";
series.strokeWidth = 4;
series.sequencedInterpolation = true;

var bullet = series.bullets.push(new am4charts.CircleBullet());
bullet.setStateOnChildren = true;
bullet.states.create("hover"); = 10;"hover").properties.radius = 15;

var labelBullet = series.bullets.push(new am4charts.LabelBullet());
labelBullet.setStateOnChildren = true;
labelBullet.states.create("hover").properties.scale = 1.2;
labelBullet.label.text = "{text}";
labelBullet.label.maxWidth = 200;
labelBullet.label.wrap = true;
labelBullet.label.truncate = false;
labelBullet.label.textAlign = "middle";
labelBullet.label.paddingLeft = 20;
labelBullet.label.paddingRight = 20;
labelBullet.label.fill = am4core.color("#999");
labelBullet.label.states.create("hover").properties.fill = am4core.color("#000");

labelBullet.label.verticalCenter = "middle";
labelBullet.label.propertyFields.horizontalCenter = "center";

chart.cursor = new am4charts.XYCursor();
chart.cursor.lineX.disabled = true;
chart.cursor.lineY.disabled = true;