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
2a5ad7e6
Commit
2a5ad7e6
authored
May 26, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bar line and pie add tooltip formatter
parent
05399770
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
264 additions
and
143 deletions
+264
-143
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+165
-122
LineMixBar.vue
components/LineMixBar/LineMixBar.vue
+23
-4
NormalBar.vue
components/NormalBar/NormalBar.vue
+23
-4
NormalLine.vue
components/NormalLine/NormalLine.vue
+23
-4
NormalPie.vue
components/NormalPie/NormalPie.vue
+30
-9
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
2a5ad7e6
This diff is collapsed.
Click to expand it.
components/LineMixBar/LineMixBar.vue
View file @
2a5ad7e6
...
...
@@ -63,10 +63,7 @@
type
:
'value'
}
],
tooltip
:
{
...
that
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
tooltip
:
that
.
dealTooltip
(
that
.
elementInfo
.
option
.
tooltip
),
toolbox
:
{
...
that
.
elementInfo
.
option
.
toolbox
,
feature
:
{
...
...
@@ -125,6 +122,28 @@
}
})
},
/**
*
* @param tooltip 表单的tooltip设置
*/
dealTooltip
(
tooltip
)
{
if
(
!
tooltip
)
{
return
}
if
(
tooltip
.
formatter
&&
tooltip
.
formatter
.
length
)
{
return
{
...
tooltip
,
formatter
:
(
val
)
=>
{
return
this
.
$u
.
common
.
converFunction
(
tooltip
.
formatter
,
val
)
},
trigger
:
"axis"
}
}
return
{
...
tooltip
,
trigger
:
"axis"
}
},
/**
* 处理数据
*/
...
...
components/NormalBar/NormalBar.vue
View file @
2a5ad7e6
...
...
@@ -49,10 +49,7 @@
...
that
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
tooltip
:
{
...
that
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
tooltip
:
that
.
dealTooltip
(
that
.
elementInfo
.
option
.
tooltip
),
toolbox
:
{
...
that
.
elementInfo
.
option
.
toolbox
,
feature
:
{
...
...
@@ -111,6 +108,28 @@
}
})
},
/**
*
* @param tooltip 表单的tooltip设置
*/
dealTooltip
(
tooltip
)
{
if
(
!
tooltip
)
{
return
}
if
(
tooltip
.
formatter
&&
tooltip
.
formatter
.
length
)
{
return
{
...
tooltip
,
formatter
:
(
val
)
=>
{
return
this
.
$u
.
common
.
converFunction
(
tooltip
.
formatter
,
val
)
},
trigger
:
"axis"
}
}
return
{
...
tooltip
,
trigger
:
"axis"
}
},
/**
* 处理数据
*/
...
...
components/NormalLine/NormalLine.vue
View file @
2a5ad7e6
...
...
@@ -51,10 +51,7 @@
...
that
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
tooltip
:
{
...
that
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
tooltip
:
that
.
dealTooltip
(
that
.
elementInfo
.
option
.
tooltip
),
toolbox
:
{
...
that
.
elementInfo
.
option
.
toolbox
,
feature
:
{
...
...
@@ -113,6 +110,28 @@
}
})
},
/**
*
* @param tooltip 表单的tooltip设置
*/
dealTooltip
(
tooltip
)
{
if
(
!
tooltip
)
{
return
}
if
(
tooltip
.
formatter
&&
tooltip
.
formatter
.
length
)
{
return
{
...
tooltip
,
formatter
:
(
val
)
=>
{
return
this
.
$u
.
common
.
converFunction
(
tooltip
.
formatter
,
val
)
},
trigger
:
"axis"
}
}
return
{
...
tooltip
,
trigger
:
"axis"
}
},
/**
* 处理数据
*/
...
...
components/NormalPie/NormalPie.vue
View file @
2a5ad7e6
...
...
@@ -40,19 +40,17 @@ export default {
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
series
}
=
this
.
elementData
.
dataList
const
{
series
}
=
this
.
elementData
.
dataList
const
that
=
this
this
.
ec
.
option
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
color
:
[
'#1089E7'
,
'#F57474'
,
'#56D0E3'
,
'#F8B448'
,
'#8B78F6'
],
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
'item'
},
series
:
this
.
dealSeriesData
(
series
)
tooltip
:
that
.
dealTooltip
(
that
.
elementInfo
.
option
.
tooltip
),
series
:
that
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
th
is
.
ec
.
option
)
chart
.
setOption
(
th
at
.
ec
.
option
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
},
...
...
@@ -65,6 +63,29 @@ export default {
}
},
/**
*
* @param tooltip 表单的tooltip设置
*/
dealTooltip
(
tooltip
)
{
if
(
!
tooltip
)
{
return
}
if
(
tooltip
.
formatter
&&
tooltip
.
formatter
.
length
)
{
return
{
...
tooltip
,
formatter
:
(
val
)
=>
{
return
this
.
$u
.
common
.
converFunction
(
tooltip
.
formatter
,
val
)
},
trigger
:
"item"
}
}
return
{
...
tooltip
,
trigger
:
"item"
}
},
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
series
=
[{
...
...
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