Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div id="container" style="width: 800px;"></div>
              
            
!

CSS

              
                
              
            
!

JS

              
                let container = document.querySelector("#container")

Highcharts.setOptions({
  chart: { height: 600 },
  title: { text: "數據列顏色" },
  plotOptions: { series: { marker: { radius: 7, symbol: "circle" } } }
})

var myChart = Highcharts.chart(container, {
  // colors: ["red", "orange", "darkblue"],      // 所有數據列依序採用陣列中顏色
  plotOptions: {
    series: { 
      // colorByPoint: true,                     // 是否要用colors設定數據點顏色
      // colors: ["coral", "Cyan", "DarkGreen"], // 所有數據列裡的數據點依序採用陣列中顏色
      // color: "green"                          // 所有數據列都採用這個顏色
    },                
    line: {
      // colorByPoint: true,                     // 是否要用colors設定數據點顏色
      // colors: ["coral", "Cyan", "DarkGreen"], // 所有數據列裡的數據點依序採用陣列中顏色
      // color: "blue"                           // 所有指定類型的數據列都採用
    }
  },
  series: [
    {
      // color: "purple",                        // 這組數據列採用這個顏色
      name: "折線圖一",
      data: [60, 60, 60, 60, 60]
    },
    {
      // colorByPoint: true,                     // 是否要用colors設定數據點顏色
      // colors: ["coral", "Cyan", "DarkGreen"], // 這組數據列裡的數據點依序採用陣列中顏色
      // lineColor: "gray",                      // 線的顏色
      name: "折線圖二",
      data: [
        40, 
        40, 
        { 
          //color: "black",                      // 這個數據點採用這個顏色
          y: 40
        },          
        40,
        40
      ]
    },
    {
      // colorByPoint: true,                     // 是否要用colors設定數據點顏色
      // lineColor: "black",                     // 線的顏色
      // fillColor: "rgba(144, 237, 125, 0.2)",  // 面積區塊的顏色
      type: "area",
      name: "面積圖",
      data: [20, 20, 20, 20, 20]
    }
  ]
});
              
            
!
999px

Console