分享一段代碼實例,它利用highcharts實現柱狀圖效果。
代碼實例如下:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | <!doctype html> < html > < head > < meta charset = "utf-8" > < title >柱狀圖</ title > < script > $(function() { $('#container').highcharts({ chart: { type: 'column' }, title: { text: '' }, xAxis: { categories: ['Android', 'iOS', 'web'] //指定x軸分組 }, yAxis: { title: { text: 'something' } }, series: [{ //指定數據列 name: '小明', //數據列名 data: [1, 0, 4] //數據 }, { name: '小紅', data: [5, 7, 3] }] }); }); </ script > </ head > < body > < div id = "container" style = "min-width:800px;height:800px;" ></ div > </ body > </ html >
|