";
}
}
contentsDiv+="
"+""+""+""+"增长率"+""+""+barSum+""+""+"增长率"+lineSum+""+"
";
tooltip="
"+""+value[0].axisValue+"资源使用情况"+""+contentsDiv+""+"
";
return tooltip;
}
},
grid: {
left: '3%',
right: '1%',
bottom: '3%',
top: "17%",
containLabel: true,
borderColor: '#1d203b'
},
legend: {
itemGap: 14,
right: '16%',
top: '2%',
//padding:[40,10,0,10],
data: [] //ToDo
},
xAxis: [{
type: 'category',
boundaryGap: true,
data: x_line,
axisLine: {
show: false
},
axisTick: {
show: false
},
//坐标轴刻度标签
axisLabel: {
textStyle: {
color: "#454e72"
},
formatter: function(value, index) {
var xName = value.substring(value.indexOf("-") + 1);
return xName.replace(/-/g, ".");
},
margin: 20
},
splitLine: {
lineStyle: {
color: "#1d203b"
}
},
}],
yAxis: [{
name: '单位(T)',
nameGap:20,
nameTextStyle:{
color:'#454e72',
fontSize: 12,
},
type: 'value',
nameGap: 15,
axisLine: {
show: false
},
axisTick: {
show: false
},
scale: true,
axisLabel: {
// formatter: function(value, idx) {
// if (idx === 0) {
// return value + "T";
// } else {
// return value;
// }
// },
textStyle: {
color: '#454e72'
},
margin: 20
},
boundaryGap: [0.2, 0.2],
splitLine: {
lineStyle: {
color: ["#1d203b"]
}
}
}, {
name: '单位(%)',
nameGap:20,
nameTextStyle:{
color:'#454e72',
fontSize: 12,
},
type: 'value',
nameGap: 15,
axisLine: {
show: false
},
axisTick: {
show: false
},
scale: true,
axisLabel: {
// formatter: function(value, idx) {
// if (idx === 0) {
// return value + "%";
// } else {
// return value;
// }
// },
textStyle: {
color: '#454e72'
},
margin: 20
},
splitLine: {
show: false,
lineStyle: {
color: ["#1d203b"]
}
},
boundaryGap: [0.2, 0.2]
}],
series: []
};
for (var i = 0; i < hdfs_stack_bar_data["namelist"].length + 1; i++) {
var namelist = hdfs_stack_bar_data["namelist"];
var series = [];
if (i < hdfs_stack_bar_data["namelist"].length) {
option.series.push({
name: namelist[i],
type: 'bar',
stack: '广告',
barWidth: "50%",
data: hdfs_stack_bar_data['dataArr_bar'][namelist[i]],
itemStyle: {
normal: {
color: colorConsArr_hdfs[i]
}
}
});
option.series.push({
name: namelist[i],
type: 'line',
yAxisIndex: 1,
data: hdfs_stack_bar_data['dataArr_line'][namelist[i]],
symbol: 'none',
smooth: true,
lineStyle: {
normal: {
barBorderRadius: 0,
width: 2.5, //连线粗细
color: colorConsArr_hdfs[i] //连线颜色
}
},
});
option.legend.data.push({
name: namelist[i],
icon: "circle",
textStyle: {
color: []
}
});
} else {
option.series.push({
name: "增长率",
type: 'bar',
stack: '广告',
barWidth: "52%",
data: [],
});
option.series.push({
name: "增长率",
type: 'line',
yAxisIndex: 1,
data: [],
symbol: 'none',
});
option.legend.data.push({
name: "增长率",
icon:'image:///asset/get/s/data-1490602888744-Bkb5iBU3g.png',
selectedMode:false,
textStyle: {
color: '#6c65fb',
fontSize:14,
}
});
}
};
myChart.setOption(option);