Commit c834ced6 authored by 陈龙's avatar 陈龙

fix: 修复历史曲线报错;设置置信区间颜色、箱线图颜色

parent c6fe1103
...@@ -13,7 +13,8 @@ const deviceParams = [ ...@@ -13,7 +13,8 @@ const deviceParams = [
// deviceCode: 'EGBF00000018', // deviceCode: 'EGBF00000018',
deviceCode: 'EGBF00000017', deviceCode: 'EGBF00000017',
// deviceCode: 'EGBF00000014', // deviceCode: 'EGBF00000014',
sensors: '今日供水量,今日用电量,1#水箱液位,是否在线', // sensors: '今日供水量,今日用电量,1#水箱液位,是否在线',
sensors: '今日供水量',
deviceType: '二供泵房', deviceType: '二供泵房',
pointAddressID: 4, pointAddressID: 4,
}, },
......
...@@ -331,12 +331,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -331,12 +331,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const seriesTemplate = (param, unit) => { const seriesTemplate = (param, unit) => {
if (!param) return ''; if (!param) return '';
const {value, encode} = param; const {value, encode} = param;
const val = value[encode.y[0]]; // const val = value[encode.y[0]];
const _unit = unit || 'Mpa'; const _unit = unit || 'Mpa';
const color = '#008CFF'; const color = '#008CFF';
if (!isArray(value)) return ` <div style="display: flex; align-items: center;"> if (!isArray(value)) return ` <div style="display: flex; align-items: center;">
<span>${param.seriesName}</span><span style="display:inline-block;">:</span> <span>${param.seriesName}</span><span style="display:inline-block;">:</span>
<span style="color:${color};margin: 0 5px 0 auto;">${value?.toFixed(3)}</span> <span style="color:${color};margin: 0 5px 0 auto;">${value?.toFixed(3) ?? '-'}</span>
<span style="font-size: 12px;">${_unit}</span> <span style="font-size: 12px;">${_unit}</span>
</div>`; </div>`;
return ` return `
...@@ -483,6 +483,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -483,6 +483,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
name: '箱线图', name: '箱线图',
symbol: 'none', symbol: 'none',
data: otherData, data: otherData,
itemStyle: {
color: '#FFA200',
color0: '#44CD00',
borderColor: '#FFA200',
borderColor0: '#44CD00'
}
}); });
tooltip = tooltipAccessor(unit) tooltip = tooltipAccessor(unit)
} else { } else {
...@@ -501,6 +507,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -501,6 +507,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}) || []; }) || [];
return _item; return _item;
}); });
console.log(series);
[[..._minData], [..._maxData]].forEach((item, index) => { [[..._minData], [..._maxData]].forEach((item, index) => {
series.push({ series.push({
name: index === 0 ? '最小值' : '最大值', name: index === 0 ? '最小值' : '最大值',
...@@ -511,7 +518,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -511,7 +518,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}, },
...(index !== 0 ? { ...(index !== 0 ? {
areaStyle: { areaStyle: {
color: '#ccc' color: series?.[0]?.itemStyle?.color ?? '#65a0d1',
opacity: 0.2,
} }
} : {}), } : {}),
stack: 'confidence-band', stack: 'confidence-band',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment