Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
李伟@五瓣科技
graph
Commits
f407b5b2
Commit
f407b5b2
authored
Jun 24, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yAxis溢出隐藏
parent
3f44675b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
3 deletions
+50
-3
App.js
src/App.js
+50
-3
No files found.
src/App.js
View file @
f407b5b2
...
@@ -121,7 +121,7 @@ class App extends Component {
...
@@ -121,7 +121,7 @@ class App extends Component {
},
},
label
:
{
label
:
{
color
:
'
#333
'
,
color
:
'
#333
'
,
position
:
'
right
'
position
:
'
center
'
},
},
symbolSize
:
15
,
symbolSize
:
15
,
...
@@ -159,11 +159,22 @@ class App extends Component {
...
@@ -159,11 +159,22 @@ class App extends Component {
{
{
type
:
'
value
'
,
type
:
'
value
'
,
}],
}],
yAxis
:
{
yAxis
:
{
type
:
'
category
'
,
type
:
'
category
'
,
data
:
this
.
state
.
AxisY
,
data
:
this
.
state
.
AxisY
,
boundaryGap
:
true
,
triggerEvent
:
true
,
axisLabel
:{
margin
:
8
,
formatter
:
function
(
data
){
var
val
=
''
if
(
data
.
length
>
4
){
val
=
data
.
substr
(
0
,
4
)
+
'
...
'
;
return
val
;
}
else
{
return
data
;
}
}
},
// min: 0,
// min: 0,
// max: 5,
// max: 5,
// scale: true,
// scale: true,
...
@@ -182,7 +193,43 @@ class App extends Component {
...
@@ -182,7 +193,43 @@ class App extends Component {
series
:
series
,
series
:
series
,
};
};
myChart
.
setOption
(
option
);
myChart
.
setOption
(
option
);
extension
(
myChart
);
function
extension
(
myChart
){
var
elementDiv
=
document
.
getElementById
(
'
extension
'
);
if
(
!
elementDiv
){
var
div
=
document
.
createElement
(
'
div
'
)
div
.
setAttribute
(
'
id
'
,
'
extension
'
)
div
.
style
.
display
=
'
block
'
document
.
querySelector
(
'
html
'
).
appendChild
(
div
)
}
myChart
.
on
(
'
mouseover
'
,
function
(
params
){
if
(
params
.
componentType
==
'
yAxis
'
)
{
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
var
elementStyle
=
'
position: absolute;margin-left:35px;z-index: 99999;color: #fff;font-size: 12px;padding: 5px;display: inline;border-radius: 4px;background-color: #303133;box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 8px
'
elementDiv
.
style
.
cssText
=
elementStyle
elementDiv
.
innerHTML
=
params
.
value
document
.
querySelector
(
'
html
'
).
onmousemove
=
function
(
event
)
{
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
var
xx
=
event
.
pageX
-
10
var
yy
=
event
.
pageY
+
15
elementDiv
.
style
.
top
=
yy
+
'
px
'
elementDiv
.
style
.
left
=
xx
+
'
px
'
}
}
})
myChart
.
on
(
'
mouseout
'
,
function
(
params
)
{
if
(
params
.
componentType
==
'
yAxis
'
)
{
var
elementDiv
=
document
.
querySelector
(
'
#extension
'
)
elementDiv
.
style
.
cssText
=
'
display:none
'
}
})
})
}
})
...
...
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