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
1496f26d
Commit
1496f26d
authored
Jan 13, 2022
by
何钱贝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:仪表盘
parent
33e7db89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
7 deletions
+63
-7
NormalGauge.vue
components/NormalGauge/NormalGauge.vue
+63
-7
No files found.
components/NormalGauge/NormalGauge.vue
View file @
1496f26d
<
template
>
<
template
>
<view>
<view>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"NormalGauge"
ref=
"canvas"
canvas-id=
"lazy-load-chart"
:ec=
"ec"
></uni-ec-canvas>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
import
uniEcCanvas
from
'@/components/uni-ec-canvas/uni-ec-canvas'
name
:
"NormalGauge"
,
import
*
as
echarts
from
'@/components/uni-ec-canvas/echarts'
data
()
{
import
echartElementData
from
'@/mixins/echartElementData.js'
return
{
let
chart
=
null
};
export
default
{
name
:
"NormalGauge"
,
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
,
tooltip
:
{
formatter
:
'{a} <br/>{b} : {c}%'
},
series
:
[{
type
:
'gauge'
,
radius
:
'90%'
,
data
:
guageChart
}]
}
chart
.
setOption
(
options
)
return
chart
})
})
},
dealSeriesData
(
data
)
{
return
data
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
...
...
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