echars——仪表盘码表
function echartsdataGA(xdata1) {
xdata1=xdata1/1;
if(xdata1<-25){
xdata1=-25;
}
var pzjdM=(xdata1+25)/125;
var colorT="";
if (xdata1/1>10){
colorT="#20EE42";
}else{
colorT="#F499A7";
}
$scope.barConfigGA = {
theme: 'gauge',
dataLoaded: true
};
$scope.optionGA = {
grid: {
left: 30,
right: 30,
top: 10,
bottom: 10
},
series: [
{
name: '刻度',
type: 'gauge',
center: ['50%', '55%'],
radius: '82%',
min: -25,
max: 100,
splitNumber: 10, //刻度数量
startAngle: 220,
endAngle: -40,
axisLabel: {
show: true,
color: '#fff',
distance: -20,
fontWeight:'bold'
},
axisLine: {
show: true,
lineStyle: {
width: 1,
color: [[1, 'rgba(255,255,255,0.8)']]
}
},//刻度标签。
axisTick: {
show: true,
lineStyle: {
color: '#fff',
width: 1
},
length: -8
},//刻度样式
splitLine: {
show: true,
length: -15,
lineStyle: {
color: '#fff'
}
},//分隔线样式
detail: {
show: false
},
pointer: {
show: false
}
},
{
type: 'gauge',
radius: '75%',
center: ['50%', '55%'],
splitNumber: 10, //刻度数量
startAngle: 220,
endAngle: -40,
axisLine: {
show: true,
lineStyle: {
width: 20,
color:
[[pzjdM, colorT], [1, '#ffffff']]
}
},
//分隔线样式。
splitLine: {
show: false
},
axisLabel: {
show: false
},
axisTick: {
show: false
},
pointer: {
show: false
},
//仪表盘详情,用于显示数据。
detail: {
show: false,
offsetCenter: [0, 0],
color: '#ddd',
formatter: function (params) {
return params
},
textStyle: {
fontSize: 40
}
},
data: [{
value: ''
}]
}
]
};
$scope.barOptionGA = $scope.optionGA;
$scope.barConfigGA.dataLoaded = true;
}