echarts图表双轴优化

This commit is contained in:
ym1026
2025-10-10 11:01:13 +08:00
parent 0975ea52d4
commit b12aca76c4
5 changed files with 237 additions and 41 deletions

View File

@@ -148,6 +148,7 @@ export default {
},
global: false,
showSymbol: false,
yAxisIndex: index,
data: result.values[index]
}
})
@@ -193,19 +194,40 @@ export default {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
yAxis: [
{
name: '充电电量(kW·h)',
type: 'value',
nameTextStyle: {
color: '#fff' // 绿色名称
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
axisLabel: {
// margin: 10,
// interval: 60,
color: '#fff',
fontSize:12,
// padding: [5, 0, 0, 0]
}
},
{
name: '充电收益(元)',
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
nameTextStyle: {
color: '#fff' // 绿色名称
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
],
series: this.chargeChartData.ydata
}
option && chargeChart.setOption(option)