分享一段代码实例,它利用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>
|