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.

78 lines
2.2 KiB

3 years ago
//散点图
3 years ago
export default function pointOption(data=[],dName = [],dx = []) {
3 years ago
return {
legend: {
left: '10%',
top: '3%',
data: dName
},
grid: {
// left: '8%',
// top: '10%'
},
3 years ago
xAxis: {
data: dx,
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;
}
},
3 years ago
yAxis: {},
series: [
{
3 years ago
name: '新车上市',
3 years ago
data: data[0],
type: 'scatter',
symbolSize: function (data) {
return data[0];
},
emphasis: {
focus: 'series',
label: {
show: true,
3 years ago
formatter: function ( param ) { return param.data[3] },
3 years ago
position: 'top'
}
},
itemStyle: {
color: '#FF4852'
}
},
{
3 years ago
name: '车展',
3 years ago
data: data[1],
type: 'scatter',
symbolSize: function (data) {
return data[1];
},
emphasis: {
focus: 'series',
label: {
show: true,
3 years ago
formatter: function (param) { return param.data[3] },
3 years ago
position: 'top'
}
},
itemStyle: {
color: '#FF6E25'
}
}
]
}
}