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.


                <div class="wrapper">
  <section class="chart-card">
      <h1 class="heading">Bitcoin Price of the last 31 days</h1>
    <canvas class="chart" id="chart" width="400" height="300"></canvas>
      <p class="source"><small>Powered by <a href="" target="_blank">CoinDesk</a></small></p>


  box-sizing: border-box
  margin: 0
  padding: 0

html, body
  height: 100%
  font-size: 100%
  font-family: Roboto, sans-serif
  min-height: 100%
  display: flex
  justify-content: center
  align-items: center

  display: flex
  flex-direction: column
  justify-content: center
  align-items: center
  width: 80%
  padding: 2%
  box-shadow: 3px 6px 30px rgba(0,0,0,0.2)
  .heading, .source
    text-align: center
    margin: 1% 0

  max-width: 1024px


                var api_url = '';

var ctx = document.getElementById('chart').getContext('2d');


function init() {

function getData() {
  var request = new XMLHttpRequest();'GET', api_url, true);

  request.addEventListener('load', function() {


function createChart(data) {
  var keys = Object.keys(data);
  var chart_data = [];

  for (var i = 0; i < keys.length; i++) {

  var chart = new Chart(ctx, {
    type: 'line',
    data: {
      labels: keys,
      datasets: [{
        label: 'Bitcoin Price (USD)',
        backgroundColor: 'rgba(244, 202, 65, 0.4)',
        borderColor: 'rgba(244, 190, 65, 0.8)',
        data: chart_data,