Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
c834ced6
Commit
c834ced6
authored
Apr 25, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复历史曲线报错;设置置信区间颜色、箱线图颜色
parent
c6fe1103
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+2
-1
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+11
-3
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
c834ced6
...
...
@@ -13,7 +13,8 @@ const deviceParams = [
// deviceCode: 'EGBF00000018',
deviceCode
:
'EGBF00000017'
,
// deviceCode: 'EGBF00000014',
sensors
:
'今日供水量,今日用电量,1#水箱液位,是否在线'
,
// sensors: '今日供水量,今日用电量,1#水箱液位,是否在线',
sensors
:
'今日供水量'
,
deviceType
:
'二供泵房'
,
pointAddressID
:
4
,
},
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
c834ced6
...
...
@@ -331,12 +331,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const
seriesTemplate
=
(
param
,
unit
)
=>
{
if
(
!
param
)
return
''
;
const
{
value
,
encode
}
=
param
;
const
val
=
value
[
encode
.
y
[
0
]];
//
const val = value[encode.y[0]];
const
_unit
=
unit
||
'Mpa'
;
const
color
=
'#008CFF'
;
if
(
!
isArray
(
value
))
return
` <div style="display: flex; align-items: center;">
<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
>
<
/div>`
;
return
`
...
...
@@ -483,6 +483,12 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
name: '箱线图',
symbol: 'none',
data: otherData,
itemStyle: {
color: '#FFA200',
color0: '#44CD00',
borderColor: '#FFA200',
borderColor0: '#44CD00'
}
});
tooltip = tooltipAccessor(unit)
} else {
...
...
@@ -501,6 +507,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}) || [];
return _item;
});
console.log(series);
[[..._minData], [..._maxData]].forEach((item, index) => {
series.push({
name: index === 0 ? '最小值' : '最大值',
...
...
@@ -511,7 +518,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
},
...(index !== 0 ? {
areaStyle: {
color: '#ccc'
color: series?.[0]?.itemStyle?.color ?? '#65a0d1',
opacity: 0.2,
}
} : {}),
stack: 'confidence-band',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment