Commit bbfbab20 by 杨琪琪

cor调用统计-图表添加单位,添加总负载仪表盘

parent fc3df2cd
var defaultLineOptions = { var defaultLineOptions = {
title: { title: {
text: 'OCR调用', text: 'OCR调用',
textStyle: {fontSize: '14px', color: "#fff"}, textStyle: {fontSize: '14px', color: "#fff"},
left: 'center' left: 'center'
}, },
...@@ -8,11 +8,12 @@ var defaultLineOptions = { ...@@ -8,11 +8,12 @@ var defaultLineOptions = {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
animation: false animation: false
} },
}, },
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
top: '20%',
bottom: '15%', bottom: '15%',
containLabel: true containLabel: true
}, },
...@@ -35,6 +36,7 @@ var defaultLineOptions = { ...@@ -35,6 +36,7 @@ var defaultLineOptions = {
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: "单位(页)",
min: 0, min: 0,
minInterval: 1, minInterval: 1,
animation: false animation: false
...@@ -70,7 +72,8 @@ var defaultXBarOptions = { ...@@ -70,7 +72,8 @@ var defaultXBarOptions = {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
animation: false animation: false
} },
// formatter: "{b}: {c}页"
}, },
xAxis: { xAxis: {
show: false, show: false,
...@@ -112,11 +115,11 @@ var defaultXBarOptions = { ...@@ -112,11 +115,11 @@ var defaultXBarOptions = {
], ],
} }
var defaultYBarOptions = { var defaultYBarOptions = {
title: { // title: {
text: 'OCR服务器资源实时监控', // text: 'OCR服务器资源实时监控',
textStyle: {fontSize: '14px', color: "#fff"}, // textStyle: {fontSize: '14px', color: "#fff"},
left: 'center' // left: 'center'
}, // },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
...@@ -147,11 +150,10 @@ var defaultYBarOptions = { ...@@ -147,11 +150,10 @@ var defaultYBarOptions = {
rotate: 270, // 可选:旋转刻度标签,以免重叠 rotate: 270, // 可选:旋转刻度标签,以免重叠
} }
}, },
yAxis: [ yAxis: {
{ type: 'value',
type: 'value' name: "单位(%)",
} },
],
series: [], series: [],
dataZoom: [ // 数据区域缩放配置 dataZoom: [ // 数据区域缩放配置
{ {
...@@ -166,3 +168,147 @@ var defaultYBarOptions = { ...@@ -166,3 +168,147 @@ var defaultYBarOptions = {
} }
] ]
} }
var defaultGaugeOptions = {
title: {
text: '',
textStyle: {fontSize: '17px', color: "#fff"},
left: 'center',
bottom:'5%'
},
series: [
{
// 第一个刻度盘
type: 'gauge',
// radius: '75%',
center: ['50%', '50%'],
// startAngle: 180,
// endAngle: 0,
min: 0,
max: 100,
progress: {
show: false,
width: 8
},
pointer: {
show: false
},
axisLine: {
lineStyle: {
width: 3,
color: [
[0.7, '#58D9F9'],
[0.9, '#ff9b3d'],
[1, '#e82c06']
]
}
},
axisTick: {
// 刻度线
distance: 0,
splitNumber: 3,
lineStyle: {
width: 1,
color: 'auto'
},
},
splitLine: {
show: false
},
axisLabel: {
show: false
},
detail: {
show: false
}
},
{
// 进度条仪表盘
type: 'gauge',
radius: '65%',
center: ['50%', '50%'],
// startAngle: 180,
// endAngle: 0,
min: 0,
max: 100,
splitNumber: 12,
progress: {
// 进度条
show: true,
roundCap: false, // 设置平角: false,圆角: true
width: 20,
itemStyle: {
color: "#58D9F9"
// color: {
// type: 'linear',
// x: 1,
// y: 0,
// x2: 0,
// y2: 0,
// colorStops: [
// {
// offset: 1,
// color: '#00acfc' // 0% 处的颜色
// },
// {
// offset: 0,
// color: '#00f8d9' // 100% 处的颜色
// }
// ],
// global: false // 缺省为 false
// }
}
},
pointer: {
//仪表盘指针
show: true,
showAbove: true,
length: '50%',
width: 20,
icon: 'arrow',
offsetCenter: [0, -10],
itemStyle: {
color: '#19ebff'
}
},
axisLine: {
roundCap: false,
lineStyle: {
width: 20,
color: [[1, '#00ffff30']] // 圆环底色
}
},
axisTick: {
show: false
},
splitLine: {
show: false
},
axisLabel: {
show: false
},
anchor: {
show: false
},
title: {
show: false
},
detail: {
valueAnimation: true,
width: '60%',
borderRadius: 8,
offsetCenter: [0, '70%'],
fontSize: 16,
fontWeight: 'bold',
formatter: '{value}%', // %文字大小调整
color: '#fff'
},
data: [
{
value: 100
}
]
},
]
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment