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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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

<script src=""></script>
<script src=""></script>

<script src=""></script>

<link href="" type="text/css" rel="stylesheet">

<div id="container"></div>


#container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;


                anychart.onDocumentReady(function () { '',
    function (data) {
      // set chart theme
      // create data table on loaded data
      var dataTable =;

      // map loaded data for the ohlc series
      var mapping = dataTable.mapAs({
        open: 1,
        high: 2,
        low: 3,
        close: 4

      // create stock chart
      var chart = anychart.stock();

      // create first plot on the chart
      var plot = chart.plot(0);

      // create ohlc series
        .legendItem({ iconType: 'rising-falling' });
      // set grid settings
      // set settings for event markers
      var eventMarkers = plot.eventMarkers();
      // set the symbol of event markers
      plot.eventMarkers().format(function() {
        return this.getData("symbol");
      // set markers data[
            { "symbol": 1, date: '1998-04-11', description: '2-for-1 Amazon stock split' },
            { "symbol": 2, date: '2000-11-01', description: 'Amazon launches Marketplace' },
        { "symbol": 3, date: '2002-07-20', description: 'Amazon launches AWS - Amazon Web Services' },
        { "symbol": 4, date: '2005-02-01', description: 'Amazon launches Prime membership' },
            { "symbol": 5, date: '2007-11-19', description: 'Amazon released the Kindle, its first e-reader for $399' },
            { "symbol": 6, date: '2014-11-15', description: 'Amazon launches Echo, a speaker powered by its digital assistant Alexa' },
        { "symbol": 7, date: '2020-03-11', description: 'Covid-19 declared as a global pandemic by WHO' }
      // create EMA indicators with period 50
        .ema(dataTable.mapAs({ value: 4 }))
        .stroke('1 #f79400');

      // create scroller series with mapped data
      chart.scroller().area(dataTable.mapAs({ value: 4 }));;
      // sets the title of the chart
      chart.title('Amazon Inc. Stock Prices');

      // set container id for the chart
      // initiate chart drawing

      // create range selector
      var rangeSelector = anychart.ui.rangeSelector();
      // init range selector