分享一段代码实例,它利用highcharts实现柱状图效果。
代码实例如下:
01020304050607080910111213141516171819202122232425262728293031323334353637383940<!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
>