This commit is contained in:
lb 2024-01-08 13:28:03 +08:00
parent d1212c8729
commit c8d392ce51
4 changed files with 16 additions and 7 deletions

View File

@ -106,7 +106,12 @@ function getOptions(source, period, trend) {
if (trend[source].length === 0) return null; if (trend[source].length === 0) return null;
return { return {
color: ["#FFD160", "#12FFF5", "#2760FF"], color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 40, right: 12, bottom: 20, left: 56 }, grid: {
top: 40,
right: 12,
bottom: 20,
left: source == "O2_float" ? 56 : 72,
},
xAxis: { xAxis: {
type: "category", type: "category",
// data: Array(7) // data: Array(7)
@ -136,14 +141,14 @@ function getOptions(source, period, trend) {
name: source == "O2_float" ? "单位:%" : "单位mg/m³", name: source == "O2_float" ? "单位:%" : "单位mg/m³",
nameTextStyle: { nameTextStyle: {
color: "#fff", color: "#fff",
fontSize: 16, fontSize: 13,
align: "right", align: "right",
}, },
type: "value", type: "value",
axisLabel: { axisLabel: {
color: "#fff", color: "#fff",
fontSize: 14, fontSize: 14,
formatter: "{value} %", formatter: "{value}",
}, },
axisLine: { axisLine: {
show: true, show: true,
@ -162,7 +167,11 @@ function getOptions(source, period, trend) {
}, },
series: [ series: [
{ {
data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), data: trend[source].map((item) =>
!(item.value == null || isNaN(+item.value))
? (+item.value).toFixed(2)
: null
),
type: "line", type: "line",
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [

View File

@ -85,7 +85,7 @@ function getOptions(source, period, trend) {
if (trend[source].length == 0) return null; if (trend[source].length == 0) return null;
return { return {
color: ["#FFD160", "#12FFF5", "#2760FF"], color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 40, right: 12, bottom: 20, left: 56 }, grid: { top: 40, right: 12, bottom: 20, left: 64 },
xAxis: { xAxis: {
type: "category", type: "category",
// data: Array(7) // data: Array(7)

View File

@ -85,7 +85,7 @@ function getOptions(source, period, trend) {
if (trend[source].length == 0) return null; if (trend[source].length == 0) return null;
return { return {
color: ["#FFD160", "#12FFF5", "#2760FF"], color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 40, right: 12, bottom: 20, left: 56 }, grid: { top: 40, right: 12, bottom: 20, left: 64 },
xAxis: { xAxis: {
type: "category", type: "category",
// data: Array(7) // data: Array(7)

View File

@ -84,7 +84,7 @@ function getOptions(source, period, trend) {
if (trend[source].length == 0) return null; if (trend[source].length == 0) return null;
return { return {
color: ["#FFD160", "#12FFF5", "#2760FF"], color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 40, right: 12, bottom: 20, left: 56 }, grid: { top: 40, right: 12, bottom: 20, left: 64 },
xAxis: { xAxis: {
type: "category", type: "category",
// data: Array(7) // data: Array(7)