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

@@ -112,16 +112,82 @@ export default {
title: '运行状态分析',
type: 'bar',
dataKey: 'users',
yAxisOption:[
{
name: '日故障次数(V)',
type: 'value',
nameTextStyle: {
color: '#fff'
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
// {
// name: '工作时长(h)',
// type: 'value',
// splitLine: {
// lineStyle: { type: 'dashed', color: '#435463' }
// },
// nameTextStyle: {
// color: '#fff'
// },
// axisLabel: {
// interval: 4,
// color: '#fff',
// fontSize:12
// },
// },
],
infoKeys: [
{ key: 'storage_num_err', label: '日故障次数', lineColor: '#0CDAF5' },
{ key: 'key2', label: '日充电工作时长', lineColor: '#2A82E4' },
{ key: 'key3', label: '日放电工作时长', lineColor: '#5AABF2' }
// { key: 'key2', label: '日充电工作时长', lineColor: '#2A82E4' }, 暂无数据
// { key: 'key3', label: '日放电工作时长', lineColor: '#5AABF2' }
]
},
{
title: '今日电压与电流分析',
type: 'line',
dataKey: 'stock',
yAxisOption:[
{
name: '电压(V)',
type: 'value',
nameTextStyle: {
color: '#fff'
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
{
name: '电流(A)',
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
nameTextStyle: {
color: '#fff'
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
],
infoKeys: [
{
key: 'V',
@@ -172,13 +238,46 @@ export default {
infoKeys: [
{ key: 'storage_num_err', label: '日充电次数', lineColor: '#0CDAF5' },
{ key: 'key3', label: '日故障次数', lineColor: '#5AABF2' },
{ key: 'key3', label: '日充电时长', lineColor: '#5AABF2' }
// { key: 'key3', label: '日充电时长', lineColor: '#5AABF2' }
]
},
{
title: '今日电压与电流分析',
type: 'line',
dataKey: 'stock',
yAxisOption:[
{
name: '电压(V)',
type: 'value',
nameTextStyle: {
color: '#fff'
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
{
name: '电流(A)',
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
nameTextStyle: {
color: '#fff'
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
],
infoKeys: [
{
key: 'V',
@@ -227,13 +326,46 @@ export default {
dataKey: 'users',
infoKeys: [
{ key: 'storage_num_err', label: '日故障次数', lineColor: '#0CDAF5' },
{ key: 'key3', label: '日发电时长', lineColor: '#5AABF2' }
// { key: 'key3', label: '日发电时长', lineColor: '#5AABF2' }
]
},
{
title: '今日电压与电流分析',
type: 'line',
dataKey: 'stock',
yAxisOption:[
{
name: '电压(V)',
type: 'value',
nameTextStyle: {
color: '#fff'
},
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
{
name: '电流(A)',
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
nameTextStyle: {
color: '#fff'
},
axisLabel: {
interval: 4,
color: '#fff',
fontSize:12
},
},
],
infoKeys: [
{
key: 'V',