新增connectNulls属性,即使存在空值情况下也连接折线

This commit is contained in:
JIANG
2025-12-22 16:34:17 +08:00
parent 716ff28898
commit 37e8e65791
2 changed files with 14 additions and 12 deletions

View File

@@ -608,6 +608,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
type: "line", type: "line",
symbol: "none", symbol: "none",
sampling: "lttb", sampling: "lttb",
connectNulls: true,
itemStyle: { itemStyle: {
color: colors[(index * 4 + sIndex) % colors.length], color: colors[(index * 4 + sIndex) % colors.length],
}, },
@@ -635,6 +636,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
type: "line", type: "line",
symbol: "none", symbol: "none",
sampling: "lttb", sampling: "lttb",
connectNulls: true,
itemStyle: { color: colors[index % colors.length] }, itemStyle: { color: colors[index % colors.length] },
data: dataset.map((item) => item[id]), data: dataset.map((item) => item[id]),
areaStyle: { areaStyle: {

View File

@@ -718,8 +718,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
{ {
name: `${id} (原始)`, name: `${id} (原始)`,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { color: colors[index % colors.length] }, itemStyle: { color: colors[index % colors.length] },
data: dataset.map((item) => item[`${id}_raw`]), data: dataset.map((item) => item[`${id}_raw`]),
@@ -727,8 +727,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
{ {
name: `${id} (清洗)`, name: `${id} (清洗)`,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { color: colors[(index + 3) % colors.length] }, itemStyle: { color: colors[(index + 3) % colors.length] },
data: dataset.map((item) => item[`${id}_clean`]), data: dataset.map((item) => item[`${id}_clean`]),
@@ -736,8 +736,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
{ {
name: `${id} (模拟)`, name: `${id} (模拟)`,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { color: colors[(index + 6) % colors.length] }, itemStyle: { color: colors[(index + 6) % colors.length] },
data: dataset.map((item) => item[`${id}_sim`]), data: dataset.map((item) => item[`${id}_sim`]),
@@ -747,8 +747,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
return deviceIds.map((id, index) => ({ return deviceIds.map((id, index) => ({
name: id, name: id,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { color: colors[index % colors.length] }, itemStyle: { color: colors[index % colors.length] },
data: dataset.map((item) => item[`${id}_${selectedSource}`]), data: dataset.map((item) => item[`${id}_${selectedSource}`]),
@@ -772,8 +772,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
: "模拟" : "模拟"
})`, })`,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { itemStyle: {
color: colors[(index * 3 + sIndex) % colors.length], color: colors[(index * 3 + sIndex) % colors.length],
@@ -800,8 +800,8 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
series.push({ series.push({
name: id, name: id,
type: "line", type: "line",
showSymbol: true, symbol: "none",
symbolSize: 4, connectNulls: true,
sampling: "lttb", sampling: "lttb",
itemStyle: { color: colors[index % colors.length] }, itemStyle: { color: colors[index % colors.length] },
data: dataset.map((item) => item[id]), data: dataset.map((item) => item[id]),