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
4ce78662
Commit
4ce78662
authored
Jan 13, 2022
by
何钱贝
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:饼图
parent
fb1b9436
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
10 deletions
+77
-10
NormalPie.vue
components/NormalPie/NormalPie.vue
+74
-7
manifest.json
manifest.json
+2
-2
project.config.json
project.config.json
+1
-1
No files found.
components/NormalPie/NormalPie.vue
View file @
4ce78662
<
template
>
<view>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"NormalPie"
ref=
"canvas"
canvas-id=
"lazy-load-chart"
:ec=
"ec"
></uni-ec-canvas>
</view>
</
template
>
<
script
>
export
default
{
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
:
"NormalPie"
,
mixins
:
[
echartElementData
],
data
()
{
return
{
ec
:
{
lazyLoad
:
true
}
};
}
onReady
()
{
},
components
:
{
uniEcCanvas
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'canvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
dataList
:
{
categories
,
series
}
}
=
this
.
elementData
const
options
=
{
...
this
.
elementInfo
.
option
,
color
:
[
'#1089E7'
,
'#F57474'
,
'#56D0E3'
,
'#F8B448'
,
'#8B78F6'
],
tooltip
:
{
trigger
:
'item'
,
formatter
:
'{a}<br/>{b}:{c}({d}%)'
},
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
return
chart
})
})
},
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
series
=
[{
type
:
'pie'
,
center
:
[
"50%"
,
"50%"
],
...
props
.
elementInfo
.
option
.
pie
,
label
:
{
...
props
.
elementInfo
.
option
.
dataset
},
labelLine
:
{
show
:
true
},
data
}]
return
series
}
}
}
</
script
>
<
style
>
...
...
manifest.json
View file @
4ce78662
...
...
@@ -62,11 +62,11 @@
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
"wx0
6342b31eebe8da7
"
,
"appid"
:
"wx0
72302256a82deb1
"
,
"setting"
:
{
"urlCheck"
:
true
,
"es6"
:
true
,
"postcss"
:
tru
e
,
"postcss"
:
fals
e
,
"minified"
:
true
},
"usingComponents"
:
true
,
...
...
project.config.json
View file @
4ce78662
...
...
@@ -35,7 +35,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.21.0"
,
"appid"
:
"wx0
6342b31eebe8da7
"
,
"appid"
:
"wx0
72302256a82deb1
"
,
"projectname"
:
"ec-report-refactor"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
何钱贝
@Bob
mentioned in commit
33e7db89
·
Jan 13, 2022
mentioned in commit
33e7db89
mentioned in commit 33e7db895731b2c3abf8e8b904902a08fa42415a
Toggle commit list
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