<div class="echarts" id="areaStatisticesEcharts"></div>
var areaNameList=[[${maiorg.areaNameList}]];
var areaCountList=[[${maiorg.areaCountList}]];
var areaChart =echarts.init(document.getElementById("areaStatisticesEcharts"));
//柱状图
var areaoption = {
color: ['#3398DB'], //设置柱状颜色
title : {
text: '各区接警数统计' //图表标题
},
tooltip : {
trigger: 'axis'
},
grid:{
x:30,
x2:20, //图表与边界距离
y2:24
},
calculable : true,
xAxis : [
{
//将横轴坐标信息全部显示
axisLabel:{ interval: 0},
type : 'category',
data : areaNameList //数据集合
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'接警数',
type:'bar',
barWidth: '40%', //设置柱状的大小
data:areaCountList, //数据集合
}
]
};
areaChart .setOption(areaoption);
$(window).resize(areaChart .resize); //设置图表自适应屏幕大小