Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
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
lihuizhen
ec-report-refactor
Commits
50a0315d
Commit
50a0315d
authored
Jan 13, 2022
by
chris.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增雷达图
parent
396df4f2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
NormalRadar.vue
components/NormalRadar/NormalRadar.vue
+89
-0
index.vue
pages/index/index.vue
+2
-0
No files found.
components/NormalRadar/NormalRadar.vue
0 → 100644
View file @
50a0315d
<
template
>
<view>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"normalra-dar"
ref=
"normalRadarCanvas"
canvas-id=
"normalra-dar-chart"
:ec=
"ec"
></uni-ec-canvas>
</view>
</
template
>
<
script
>
import
uniEcCanvas
from
'@/components/uni-ec-canvas/uni-ec-canvas'
import
*
as
echarts
from
'@/components/uni-ec-canvas/echarts'
import
echartElementData
from
'@/mixins/echartElementData.js'
let
chart
=
null
export
default
{
name
:
"NormalRadar"
,
mixins
:
[
echartElementData
],
data
()
{
return
{
ec
:
{
lazyLoad
:
true
}
}
},
onReady
()
{
},
components
:
{
uniEcCanvas
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalRadarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
dataList
:
{
indicator
,
series
}
}
=
this
.
elementData
const
config
=
{
tooltip
:
{},
radar
:
{
indicator
},
series
:
[{
type
:
'radar'
,
label
:
{
...
this
.
elementInfo
.
option
.
dataset
},
data
:
this
.
dealSeriesData
(
series
)
}]
}
chart
.
setOption
(
config
)
return
chart
})
})
},
/**
* 处理数据
*/
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
newData
=
data
.
map
(
item
=>
{
const
{
name
,
data
:
value
}
=
item
return
{
name
,
value
}
})
return
newData
}
}
}
</
script
>
<
style
scoped
>
</
style
>
pages/index/index.vue
View file @
50a0315d
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
<NormalPie
v-if=
"element.type == 'NormalPie'"
:elementInfo=
"element"
></NormalPie>
<NormalPie
v-if=
"element.type == 'NormalPie'"
:elementInfo=
"element"
></NormalPie>
<!-- 中国地图 -->
<!-- 中国地图 -->
<ChinaMap
v-if=
"element.type == 'ChinaMap'"
:elementInfo=
"element"
></ChinaMap>
<ChinaMap
v-if=
"element.type == 'ChinaMap'"
:elementInfo=
"element"
></ChinaMap>
<!-- 雷达图 -->
<NormalRadar
v-if=
"element.type == 'NormalRadar'"
:elementInfo=
"element"
></NormalRadar>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
...
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