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 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 id="chart"></div>




                var chart = c3.generate({
	bindto: "#chart",
	data: {
		columns: [
			["data1", 30, 200, 100, 400, 150, 250],
			["data2", 50, 20, 10, 40, 15, 25]
		//新增 data2 的數據在右邊
		axes: {
			data2: "y2"
		types: {
			data1: "line", //指定 data1 的圖表類型
			data2: "bar" // 指定 data2 的圖表類型
		//自訂 data 顏色
		colors: {
			data1: "#03A9F4",
			data2: "#76FF03"
	legend: {
		show: true //是否顯示項目
	axis: {
		//客製 X 軸內容
		x: {
			type: "category",
			categories: [2000, 2001, 2002, 2003, 2004, 2005],
			label: {
				text: "X軸名稱"
		//客製 Y 軸內容
		y: {
			label: {
				text: "左邊Y軸名稱",
				position: "outer-middle" //名稱位置
		//客製右側 (data2) Y2 軸內容
		y2: {
			show: true,
			label: {
				text: "右邊Y軸名稱",
				position: "outer-middle" //名稱位置