chart1() {
let chart = document.getElementById('chart1');
let myChar = echarts.init(chart);
//X轴
let dataX = ['2023-09-14', '2023-09-15', '2023-09-16', '2023-09-17', '2023-09-18', '2023-09-19', '2023-09-20']
//Y轴-反平衡热效率
let dataY1 = [86, 74, 82, 74, 69, 75, 80];
//Y轴-加热炉负荷率
let dataY2 = [96, 86, 75, 85, 72, 88, 71];
let option;
option = {
color: ['#5087EC', '#EDA2AE'],
title: {
left: 'center',
text: '加热炉热效率及负荷率情况'
},
legend: {
data: ['反平衡热效率', '加热炉负荷率'],
top: "8%",
},
tooltip: {
trigger: 'axis'
},
grid: {
left: '3%',
right: '4%',
top: '20%',
bottom: 40,
//containLabel: true
},
xAxis: {
type: 'category',
//boundaryGap: false,
data: dataX
},
yAxis: {
type: 'value',
name: '%'
},
series: [
{
name: '反平衡热效率',
data: dataY1,
type: 'line',
areaStyle: {
color: "rgba(80,135,236, 0.4)"
}
},
{
name: '加热炉负荷率',
data: dataY2,
type: 'line',
areaStyle: {
color: "rgba(222,134,143, 0.4)"
}
},
]
};
myChar.clear();//清除图表
myChar.setOption(option);//set数据
myChar.resize();//重绘
window.addEventListener("resize", () => {
myChar.resize();
});
}
03-14
150
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-07
3万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-29
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交