You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// 折线
|
|
|
|
export default function singleLine(dValue=[],dx=[]){
|
|
|
|
return{
|
|
|
|
grid:{
|
|
|
|
left: 55,
|
|
|
|
top: 25,
|
|
|
|
height: 126,
|
|
|
|
width: 265
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: "axis",
|
|
|
|
backgroundColor: "#08182F",
|
|
|
|
color: "#fff",
|
|
|
|
borderColor: "#3373CC",
|
|
|
|
textStyle: {
|
|
|
|
color: "#fff", //设置文字颜色
|
|
|
|
fontSize: 9
|
|
|
|
}
|
|
|
|
},
|
|
|
|
yAxis: [
|
|
|
|
{
|
|
|
|
type: 'value',
|
|
|
|
axisTick:{
|
|
|
|
show:false //去除刻度线
|
|
|
|
},
|
|
|
|
axisLine:{
|
|
|
|
show:false //去除轴线
|
|
|
|
},
|
|
|
|
axisLabel: {
|
|
|
|
color: '#999999',//y轴文本颜色
|
|
|
|
textStyle: {
|
|
|
|
fontSize : 9
|
|
|
|
}
|
|
|
|
},
|
|
|
|
splitLine: { //分割线
|
|
|
|
// lineStyle:{
|
|
|
|
// // color:"#2d3436"
|
|
|
|
|
|
|
|
// }
|
|
|
|
show: true,
|
|
|
|
lineStyle: {
|
|
|
|
type: 'dashed',
|
|
|
|
color: '#E8E8E8',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
xAxis: [
|
|
|
|
{
|
|
|
|
type: 'category',
|
|
|
|
data: dx,
|
|
|
|
axisTick:{
|
|
|
|
show:false //去除刻度线
|
|
|
|
},
|
|
|
|
axisLine:{
|
|
|
|
show:false, //去除轴线
|
|
|
|
},
|
|
|
|
axisLabel: {
|
|
|
|
color: '#999999',//x轴文本颜色
|
|
|
|
textStyle: {
|
|
|
|
fontSize : 9
|
|
|
|
},
|
|
|
|
formatter: (value) => {
|
|
|
|
let rex = "00:00:00";
|
|
|
|
let isCont = false;
|
|
|
|
let str = value;
|
|
|
|
for(let i = 0;i<dx.length-1;i++){
|
|
|
|
//连续两条带小时
|
|
|
|
if(dx[i].indexOf(rex) === -1 && dx[i+1].indexOf(rex) === -1){
|
|
|
|
isCont = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(value.length > 9) {
|
|
|
|
if(isCont == true) {
|
|
|
|
str = value.substring(10, 16)
|
|
|
|
} else {
|
|
|
|
str = value.substring(5, 10)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
series:{
|
|
|
|
type: 'line',
|
|
|
|
symbol:'none', //去圆点
|
|
|
|
data: dValue,
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
color: '#0084FF',
|
|
|
|
lineStyle: {
|
|
|
|
color: '#0084FF'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|