Pen Settings

HTML

CSS

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

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

Auto Save

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: 600px;"></div>
              
            
!

CSS

              
                
              
            
!

JS

              
                const container = document.querySelector('#container');

let specifyPoint = {
  x: new Date("2020/9/3 12:00").getTime(),
  y: 36,
  color: "red",
  custom: "中午12:00"
}

Highcharts.setOptions({
  lang: {
    shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
    weekdays: ["星期一","星期二","星期三","星期四","星期五","星期六","星期日"]
  }
})

var myChart = Highcharts.chart(container, {
  title: { text: "臺北市每日氣溫" },
  subtitle: { text: "2020年9月第一週" },
  credits: { enabled: false },
  xAxis: {
    type: "datetime",
    tickInterval: 24 * 3600 * 1000,
    labels: { 
      format: "{value:%b%e}日"
    }
  },
  yAxis: {
    title: { text: "攝氏溫度" },
    labels: { format: "{value}°C"}
  },
  tooltip: {
    headerFormat: "{point.key:%Y/%m/%d %A}<br/>",
    pointFormatter() {
      let type =  this.custom ? "最高溫度" : "平均溫度";
      let time = this.custom ? `(${this.custom})` : "" ;
      return `${type}: ${this.y}°C ${time}`
    }
  },
  time: {
     timezoneOffset: -480
  },
  series: [{
    name: "平均溫度",
    data: [30, 30, 31, 28, specifyPoint, 29, 29, 28],
    pointStart: new Date("2020/8/31").getTime(),
    // pointStart: Date.UTC(2020, 7, 31),
    pointInterval: 24 * 3600 * 1000,
  }]
});

              
            
!
999px

Console