This commit is contained in:
lb
2024-01-04 10:58:20 +08:00
parent 0b1d3aa4b3
commit ac772e2caf
15 changed files with 241 additions and 111 deletions

View File

@@ -106,7 +106,7 @@ function getOptions(source, period, trend) {
if (trend[source].length === 0) return null;
return {
color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 38, right: 12, bottom: 20, left: 48 },
grid: { top: 40, right: 12, bottom: 20, left: 56 },
xAxis: {
type: "category",
// data: Array(7)
@@ -133,16 +133,16 @@ function getOptions(source, period, trend) {
},
},
yAxis: {
name: source == 'O2_float' ? "单位:%" : "单位mg/m³",
name: source == "O2_float" ? "单位:%" : "单位mg/m³",
nameTextStyle: {
color: "#fff",
fontSize: 10,
fontSize: 16,
align: "right",
},
type: "value",
axisLabel: {
color: "#fff",
fontSize: 12,
fontSize: 14,
formatter: "{value} %",
},
axisLine: {
@@ -162,7 +162,7 @@ function getOptions(source, period, trend) {
},
series: [
{
data: trend[source].map((item) => item.value),
data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null),
type: "line",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@@ -208,6 +208,11 @@ function getOptions(source, period, trend) {
],
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
className: "xc-chart-tooltip",
// backgroundColor: ''
},
};
}