1. 程式人生 > >highchart 柱狀圖,單個樣例

highchart 柱狀圖,單個樣例

var chart = Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    title: {
        text: '月平均氣溫'
    },
    subtitle: {
        text: '資料來源: WorldClimate.com'
    },
    xAxis: {
        categories: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12','13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24']
    },
    yAxis: {
        title: {
            text: 
'氣溫 (°C)' } }, plotOptions: { column: { dataLabels: { enabled: true, style: { color: '#555', fontSize: '12px', fontFamily: '宋體', textShadow:
false, textOutline: "none" } }, //pointWidth:35, //柱子寬度,如果設定該值,則下面2個屬性無效 pointPadding: 0.1,//每列之間的距離值,預設此值為0.1 //groupPadding: 0.1,//每個值之間的間距,其實和poingPadding有一樣的效果。不過這個主要是用於對付存在分組的情況 //borderWidth: 0, shadow: false
} }, series: [{ name: '東京', data: [7, 6, 9, 14, 18, 21, 25, 26, 23, 18, 13, 9,7, 6, 9, 14, 18, 21, 25, 26, 23, 18, 13, 9] }] });