1
This commit is contained in:
353
src/views/ueScreen/components/options.ts
Normal file
353
src/views/ueScreen/components/options.ts
Normal file
@ -0,0 +1,353 @@
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export let option1 = {
|
||||
// 图例
|
||||
legend: {
|
||||
top: '10px',
|
||||
right: '20px',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [
|
||||
{ name: 'A区', itemStyle: { color: '#00bfff' } },
|
||||
{ name: 'B区', itemStyle: { color: '#00f5a6' } },
|
||||
{ name: 'C区', itemStyle: { color: '#ffa500' } }
|
||||
]
|
||||
},
|
||||
// 网格
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '3%',
|
||||
bottom: '3%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
// X轴
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
},
|
||||
data: ['00:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00', '24:00']
|
||||
},
|
||||
// Y轴
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(255,255,255,0.2)'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
},
|
||||
min: 0,
|
||||
max: 100,
|
||||
interval: 25
|
||||
},
|
||||
// 系列
|
||||
series: [
|
||||
{
|
||||
name: 'A区',
|
||||
type: 'line',
|
||||
data: [15, 70, 40, 55, 65, 85, 30, 80, 60],
|
||||
lineStyle: {
|
||||
color: '#00bfff',
|
||||
width: 2
|
||||
},
|
||||
areaStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0, color: 'rgba(0, 191, 255, 0.3)'
|
||||
}, {
|
||||
offset: 1, color: 'rgba(0, 191, 255, 0.0)'
|
||||
}]
|
||||
}
|
||||
},
|
||||
symbol: 'none',
|
||||
smooth: true
|
||||
},
|
||||
{
|
||||
name: 'B区',
|
||||
type: 'line',
|
||||
data: [50, 20, 45, 50, 85, 70, 50, 60, 50],
|
||||
lineStyle: {
|
||||
color: '#00f5a6',
|
||||
width: 2
|
||||
},
|
||||
areaStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0, color: 'rgba(0, 245, 166, 0.3)'
|
||||
}, {
|
||||
offset: 1, color: 'rgba(0, 245, 166, 0.0)'
|
||||
}]
|
||||
}
|
||||
},
|
||||
symbol: 'none',
|
||||
smooth: true
|
||||
},
|
||||
{
|
||||
name: 'C区',
|
||||
type: 'line',
|
||||
data: [20, 50, 30, 35, 30, 35, 30, 35, 30],
|
||||
lineStyle: {
|
||||
color: '#ffa500',
|
||||
width: 2
|
||||
},
|
||||
areaStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0, color: 'rgba(255, 165, 0, 0.3)'
|
||||
}, {
|
||||
offset: 1, color: 'rgba(255, 165, 0, 0.0)'
|
||||
}]
|
||||
}
|
||||
},
|
||||
symbol: 'none',
|
||||
smooth: true
|
||||
}
|
||||
],
|
||||
// 背景透明(适配你的场景)
|
||||
backgroundColor: 'transparent'
|
||||
};
|
||||
|
||||
export let option2 = {
|
||||
// 图例
|
||||
legend: {
|
||||
top: '10px',
|
||||
right: '20px',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
data: [
|
||||
{ name: '发电量', itemStyle: { color: '#00f5a6' } },
|
||||
{ name: '发电趋势', itemStyle: { color: '#ffa500' } }
|
||||
]
|
||||
},
|
||||
// 网格
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '3%',
|
||||
bottom: '3%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
// X轴
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
data: ['周一', '周二', '周三', '周四', '周五']
|
||||
},
|
||||
// Y轴
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '单位: Kwh',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(255,255,255,0.2)'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
min: 0,
|
||||
max: 5000,
|
||||
interval: 1000
|
||||
},
|
||||
// 系列
|
||||
series: [
|
||||
{
|
||||
name: '发电量',
|
||||
type: 'bar',
|
||||
data: [2800, 1800, 1200, 1700, 1500],
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0, color: 'rgba(0, 245, 166, 0.8)'
|
||||
}, {
|
||||
offset: 1, color: 'rgba(0, 245, 166, 0.2)'
|
||||
}]
|
||||
},
|
||||
borderRadius: [4, 4, 0, 0]
|
||||
},
|
||||
barWidth: '30px'
|
||||
},
|
||||
{
|
||||
name: '发电趋势',
|
||||
type: 'line',
|
||||
data: [1800, 4000, 2500, 4000, 2000],
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 209, 92, 1)',
|
||||
width: 2
|
||||
},
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
itemStyle: {
|
||||
color: 'rgba(255, 209, 92, 1)',
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
},
|
||||
smooth: false
|
||||
}
|
||||
],
|
||||
// 背景透明
|
||||
backgroundColor: 'transparent'
|
||||
};
|
||||
|
||||
export let option3 = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['光照度', '功率'],
|
||||
top: '5%',
|
||||
textStyle: {
|
||||
color: '#fff' // 若背景是深色,确保文字颜色可见
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['00:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00', '24:00']
|
||||
},
|
||||
yAxis: {
|
||||
name: '单位: Kwh',
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
formatter: '{value}',
|
||||
fontSize: 20
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(192, 192, 192, 0.3)',
|
||||
width: 1,
|
||||
type: [5, 10]
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '光照度',
|
||||
type: 'line',
|
||||
data: [5.5, 5, 9, 11, 11.5, 12, 11.8, 12, 13],
|
||||
itemStyle: {
|
||||
color: '#4895ef'
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgba(72, 149, 239, 0.8)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgba(72, 149, 239, 0.2)'
|
||||
}
|
||||
])
|
||||
},
|
||||
smooth: true
|
||||
},
|
||||
{
|
||||
name: '功率',
|
||||
type: 'line',
|
||||
data: [2, 15, 5, 2, 3, 2.5, 3, 4, 5.5],
|
||||
itemStyle: {
|
||||
color: '#98e6cd'
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgba(152, 230, 205, 0.8)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgba(152, 230, 205, 0.2)'
|
||||
}
|
||||
])
|
||||
},
|
||||
smooth: true
|
||||
}
|
||||
],
|
||||
backgroundColor: 'transparent'
|
||||
};
|
||||
Reference in New Issue
Block a user