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.


                <svg id="myGraph"></svg>



                svg { width: 320px; height: 140px; padding-top:10px; border: 1px solid black; }
#myGraph rect {
    stroke: rgb(0, 0, 0);
    stroke-width: 1px;
    fill: rgb(255, 0, 0);


                // Dataの定義
var dataSet = [300, 130, 5, 60, 240];

// myGraphへ適応させていく"#myGraph")
    .selectAll('rect') // 追加される要素がすべてrect
    .data(dataSet) // 処理する対象データ
    .enter() // データの数によってrect要素を生成
    .append('rect') // svgの四角形を生成
    .attr('x', 0) // x座標は全部0
    .attr('y', function(d, i){ // データを25pxずつずらして重ならないようにする
        return i * 25;
    .attr('width', function(d, i){ // データの値を横の長さにする
        return d +'px';
    .attr('height', '20px'); // 棒グラフの高さ指定