Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
鲁尚清
3 years ago
Commit
50e7465c8f3b39a90e765a63439999b085cdf91c
1 parent
49f6bf13
【1015】 告警概览:告警趋势折线图优化:线上提示文字,X轴文字样式
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
hg-monitor-web-base/src/main/resources/static/src/controller/overviewIndex.js
hg-monitor-web-base/src/main/resources/static/src/controller/overviewIndex.js
View file @
50e7465
...
...
@@ -326,18 +326,41 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart
show
:
true
,
interval
:
0
,
rotate
:
15
,
padding
:[
10
,
10
,
0
,
0
],
formatter
:
val
=>
{
// 一行字数
const
max
=
6
// 标签长度
const
valLength
=
val
.
length
// 换行数
const
rowNum
=
valLength
/
6
if
(
valLength
>
6
)
{
return
val
.
slice
(
0
,
5
)
+
'...'
;
}
else
{
return
val
const
valLength
=
val
.
length
;
//lsq x轴文字超出6个字符,两行 省略 2022-08-19
let
newParamsName
=
''
;
// 总行数
const
rowNum
=
Math
.
ceil
(
valLength
/
max
)
if
(
valLength
>
max
){
for
(
let
p
=
0
;
p
<
rowNum
;
p
++
){
let
tempStr
=
''
;
let
start
=
p
*
max
;
let
end
=
start
+
max
;
if
(
p
==
rowNum
-
1
){
tempStr
=
val
.
substring
(
start
,
valLength
);
}
else
{
if
(
p
>
1
){
tempStr
=
"..."
;
newParamsName
+=
tempStr
;
break
;
}
else
{
tempStr
=
val
.
substring
(
start
,
end
);
if
(
p
<
1
){
tempStr
+=
"\n"
;
}
}
}
newParamsName
+=
tempStr
;
}
}
else
{
newParamsName
=
val
;
}
return
newParamsName
}
},
axisLine
:
{
...
...
Please
register
or
login
to post a comment