Authored by 王涛
... ... @@ -375,7 +375,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
grid: [{
top: 20,
bottom: 45,
left: 30,
left: 40,
right: 5
}],
xAxis: [{
... ... @@ -439,7 +439,121 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
});
});
}
/********************单独加载更多****************************/
function loadNoticeMoreChart(echartObject,xData,yData) {
var series = [{
name: '通知次数',
data: yData,
barWidth: 20,
type: 'bar',
label: {
show: true,
position: 'top',
textStyle: {
color: '#555'
},
},
itemStyle: {
normal: {
color: (params) => {
var colors = ['#b6c2ff', '#96edc1', '#fcb75b'];
return colors[params.dataIndex % 3]
}
}
},
emphasis: {
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#2378f7' },
{ offset: 0.7, color: '#2378f7' },
{ offset: 1, color: '#83bff6' }
])
}
},
}]
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: [{
top: 20,
bottom: 70,
left: 30,
right: 5
}],
xAxis: [{
type: 'category',
data: xData,
axisLabel: {
color: '#333',
show: true,
interval:0,
rotate:15
},
axisLine: {
lineStyle: {
color: '#e7e7e7'
}
},
axisTick: {
lineStyle: {
color: '#e7e7e7'
}
},
zlevel: 1
}],
yAxis: [{
type: 'value',
gridIndex: 0,
axisLabel: {
color: '#333'
},
splitLine: {
lineStyle: {
type: 'dashed'
}
},
axisLine: {
lineStyle: {
color: '#ccc'
}
},
axisTick: {
lineStyle: {
color: '#ccc'
}
}
}],
series: series,
dataZoom: [
{ type: 'slider',
show: true,
xAxisIndex: [0],
left: '1%',
bottom: -5,
start: 0,
end: 50 //初始化滚动条
}
],
}
echartObject.setOption(option)
window.onresize=function(){
echartObject.resize();
}
// const zoomSize = 6;
// echartObject.on('click', function (params) {
// echartObject.dispatchAction({
// type: 'dataZoom',
// startValue: xData[Math.max(params.dataIndex - zoomSize / 2, 0)],
// endValue:
// xData[Math.min(params.dataIndex + zoomSize / 2, yData.length - 1)]
// });
// });
}
//获取图表数据
function getChartData() {
var where = {
... ... @@ -522,7 +636,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
var yData = res.map.countList;
var xData = res.map.userList;
//展示前20条数据 @Editor LH
loadNoticeChart(noticeTypeChartNew,xData, yData);
loadNoticeMoreChart(noticeTypeChartNew,xData, yData);
}
}
})
... ...
... ... @@ -237,7 +237,10 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart
show: true,
position: 'top',
textStyle: {
color: '#555'
color: '#555',
// Start 增加padding LSQ 2021/12/29 10:17
padding:[5,0,5,0]
//End LSQ 2021/12/29 10:17
}
}
},{
... ...
... ... @@ -16,17 +16,31 @@
<div class="layui-card" style="min-height: calc(30% - 15px)">
<div class="layui-card-body">
<div style="display: flex" class="layui-card-echart">
<div style="width: 60%!important;">
<!--1单独一行,宽度由60%设为100%// Start LSQ 2021/12/29 10:19-->
<div style="width: 100%!important;">
<h5 class="lay-row-title">告警趋势图(24小时)</h5>
<div class="pie-chart" id="overview_alarm_trend"></div>
</div>
<div style="width: 40%!important;">
</div>
</div>
</div>
<!--2和5一行 // Start LSQ 2021/12/29 10:18-->
<div class="layui-card" style="min-height: calc(30% - 15px)">
<div class="layui-card-body">
<div style="display: flex" class="layui-card-echart">
<div style="width: 50%!important;">
<h5 class="lay-row-title">指标告警统计Top10</h5>
<div class="pie-chart" id="overview_alarm_kpi"></div>
</div>
<div style="flex-grow: 1">
<h5 class="lay-row-title">业务域告警统计Top10</h5>
<div class="pie-chart" id="overview_alarm_domain"></div>
</div>
</div>
</div>
</div>
<!--//End LSQ 2021/12/29 10:18-->
<div class="layui-card" style="min-height: calc(30% - 15px)">
<div class="layui-card-body">
... ... @@ -39,10 +53,10 @@
<h5 class="lay-row-title">业务类型告警统计Top10</h5>
<div class="pie-chart" id="overview_alarm_busType"></div>
</div>
<div style="flex-grow: 1">
<!-- <div style="flex-grow: 1">
<h5 class="lay-row-title">业务域告警统计Top10</h5>
<div class="pie-chart" id="overview_alarm_domain"></div>
</div>
</div>-->
</div>
</div>
</div>
... ...
... ... @@ -103,9 +103,9 @@
</article>
<!--上传弹框-->
<script id="more_info" type="text/html">
<div style="align:center;">
<div class="lay-row-title" > 人员分组统计 <div style=" float:right;"></div></div>
<div class="pie-chart" style="height: 350px" id="notice_chart_type_new"></div>
<div style="align:center;padding: 20px;height: 330px">
<div class="lay-row-title" lay-tips="灰色拖动条可以左右拉缩并拖动展示其它数据"> 人员分组统计 </div>
<div class="pie-chart" style="height: 100%" id="notice_chart_type_new"></div>
</div>
</script>
<script>
... ...