parent
92d1f80829
commit
ea5f3329ae
@ -1,130 +1,133 @@
|
||||
// 多折线
|
||||
export default function brokenLines(dName = [], dValue = [], dColor = [], dx = []) {
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
backgroundColor: "#08182F",
|
||||
color: "#fff",
|
||||
borderColor: "#3373CC",
|
||||
textStyle: {
|
||||
color: "#fff", //设置文字颜色
|
||||
fontSize: 9
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
backgroundColor: "#08182F",
|
||||
color: "#fff",
|
||||
borderColor: "#3373CC",
|
||||
textStyle: {
|
||||
color: "#fff", //设置文字颜色
|
||||
fontSize: 9
|
||||
},
|
||||
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
|
||||
confine: true,
|
||||
},
|
||||
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
|
||||
confine: true,
|
||||
},
|
||||
legend: {
|
||||
icon: 'rectangle', //data图标样式
|
||||
itemWidth: 8, //data图标大小
|
||||
itemHeight: 8,
|
||||
left: 5,
|
||||
textStyle: {
|
||||
fontSize: 8,
|
||||
fontWeight: 400
|
||||
},
|
||||
// data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'],
|
||||
data: dName
|
||||
// color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'],
|
||||
}, //图表位置
|
||||
grid: {
|
||||
left: 7,
|
||||
right: 7,
|
||||
bottom: 7,
|
||||
top: 36,
|
||||
containLabel: true
|
||||
},
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
axisTick: {
|
||||
show: false //去除刻度线
|
||||
},
|
||||
axisLine: {
|
||||
show: false //去除轴线
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#999999', //y轴文本颜色
|
||||
textStyle: {
|
||||
fontSize: 9
|
||||
legend: {
|
||||
icon: 'rectangle', //data图标样式
|
||||
itemWidth: 8, //data图标大小
|
||||
itemHeight: 8,
|
||||
left: 5,
|
||||
textStyle: {
|
||||
fontSize: 8,
|
||||
fontWeight: 400
|
||||
},
|
||||
// data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'],
|
||||
data: dName
|
||||
// color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'],
|
||||
}, //图表位置
|
||||
grid: {
|
||||
left: 7,
|
||||
right: 7,
|
||||
bottom: 7,
|
||||
top: 36,
|
||||
containLabel: true
|
||||
},
|
||||
formatter: (value) => {
|
||||
if (value >= 10000) {
|
||||
value = (value / 10000) + '万';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
splitLine: { //分割线
|
||||
// lineStyle:{
|
||||
// // color:"#2d3436"
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
axisTick: {
|
||||
show: false //去除刻度线
|
||||
},
|
||||
axisLine: {
|
||||
show: false //去除轴线
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#999999', //y轴文本颜色
|
||||
textStyle: {
|
||||
fontSize: 9
|
||||
},
|
||||
formatter: (value) => {
|
||||
if (value >= 10000) {
|
||||
value = (value / 10000) + '万';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
splitLine: { //分割线
|
||||
// lineStyle:{
|
||||
// // color:"#2d3436"
|
||||
|
||||
// }
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed',
|
||||
color: '#E8E8E8',
|
||||
}
|
||||
}
|
||||
}],
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
// data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'],
|
||||
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;
|
||||
// }
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed',
|
||||
color: '#E8E8E8',
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isCont == true) {
|
||||
str = value.substring(10, 16)
|
||||
} else {
|
||||
str = value.substring(5, 10)
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}],
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
// data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'],
|
||||
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==7){
|
||||
return str
|
||||
}
|
||||
if (isCont == true) {
|
||||
str = value.substring(10, 16)
|
||||
} else {
|
||||
str = value.substring(5, 10)
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
}],
|
||||
series: Multiple(dName, dValue, dColor)
|
||||
}
|
||||
}
|
||||
}],
|
||||
series: Multiple(dName, dValue, dColor)
|
||||
}
|
||||
}
|
||||
|
||||
function Multiple(dName = [], dValue = [], dColor = []) {
|
||||
// MS true为单fales为双
|
||||
let list = []
|
||||
for (let i = 0; i < dName.length; i++) {
|
||||
// const element = array[index];
|
||||
// MS true为单fales为双
|
||||
let list = []
|
||||
for (let i = 0; i < dName.length; i++) {
|
||||
// const element = array[index];
|
||||
|
||||
list.push({
|
||||
name: dName[i],
|
||||
type: 'line',
|
||||
symbol: 'none', //去圆点
|
||||
data: dValue[i],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: dColor[i],
|
||||
lineStyle: {
|
||||
color: dColor[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return list;
|
||||
list.push({
|
||||
name: dName[i],
|
||||
type: 'line',
|
||||
symbol: 'none', //去圆点
|
||||
data: dValue[i],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: dColor[i],
|
||||
lineStyle: {
|
||||
color: dColor[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return list;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"c-echars": "../../../../../../components/c-echars/index"
|
||||
"c-echars": "../../../../../../components/c-echars/index",
|
||||
"word-cloud": "../../../../../components/word-cloud/index"
|
||||
},
|
||||
"component": true
|
||||
}
|
Loading…
Reference in new issue