Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
03a257d4
提交
03a257d4
authored
5月 09, 2022
作者:
junjun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 辅助线增加显示名称同时位置跟随坐标轴
上级
3cb51ed9
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
57 行增加
和
16 行删除
+57
-16
common.js
frontend/src/views/chart/chart/common/common.js
+16
-2
common_antv.js
frontend/src/views/chart/chart/common/common_antv.js
+41
-14
没有找到文件。
frontend/src/views/chart/chart/common/common.js
浏览文件 @
03a257d4
...
@@ -209,6 +209,14 @@ export function seniorCfg(chart_option, chart) {
...
@@ -209,6 +209,14 @@ export function seniorCfg(chart_option, chart) {
symbol
:
'none'
,
symbol
:
'none'
,
data
:
[]
data
:
[]
}
}
const
customStyle
=
JSON
.
parse
(
chart
.
customStyle
)
let
xAxis
,
yAxis
if
(
customStyle
.
xAxis
)
{
xAxis
=
JSON
.
parse
(
JSON
.
stringify
(
customStyle
.
xAxis
))
}
if
(
customStyle
.
yAxis
)
{
yAxis
=
JSON
.
parse
(
JSON
.
stringify
(
customStyle
.
yAxis
))
}
senior
.
assistLine
.
forEach
(
ele
=>
{
senior
.
assistLine
.
forEach
(
ele
=>
{
if
(
chart
.
type
.
includes
(
'horizontal'
))
{
if
(
chart
.
type
.
includes
(
'horizontal'
))
{
chart_option
.
series
[
0
].
markLine
.
data
.
push
({
chart_option
.
series
[
0
].
markLine
.
data
.
push
({
...
@@ -223,7 +231,10 @@ export function seniorCfg(chart_option, chart) {
...
@@ -223,7 +231,10 @@ export function seniorCfg(chart_option, chart) {
show
:
true
,
show
:
true
,
color
:
ele
.
color
,
color
:
ele
.
color
,
fontSize
:
10
,
fontSize
:
10
,
position
:
'insideStartTop'
position
:
xAxis
.
position
===
'bottom'
?
'insideStartTop'
:
'insideEndTop'
,
formatter
:
function
(
param
)
{
return
ele
.
name
+
' : '
+
param
.
value
}
},
},
tooltip
:
{
tooltip
:
{
show
:
false
show
:
false
...
@@ -242,7 +253,10 @@ export function seniorCfg(chart_option, chart) {
...
@@ -242,7 +253,10 @@ export function seniorCfg(chart_option, chart) {
show
:
true
,
show
:
true
,
color
:
ele
.
color
,
color
:
ele
.
color
,
fontSize
:
10
,
fontSize
:
10
,
position
:
'insideStartTop'
position
:
yAxis
.
position
===
'left'
?
'insideStartTop'
:
'insideEndTop'
,
formatter
:
function
(
param
)
{
return
ele
.
name
+
' : '
+
param
.
value
}
},
},
tooltip
:
{
tooltip
:
{
show
:
false
show
:
false
...
...
frontend/src/views/chart/chart/common/common_antv.js
浏览文件 @
03a257d4
...
@@ -421,9 +421,9 @@ function transAxisPosition(chart, axis) {
...
@@ -421,9 +421,9 @@ function transAxisPosition(chart, axis) {
if
(
chart
.
type
.
includes
(
'horizontal'
))
{
if
(
chart
.
type
.
includes
(
'horizontal'
))
{
switch
(
axis
.
position
)
{
switch
(
axis
.
position
)
{
case
'top'
:
case
'top'
:
return
'right'
case
'bottom'
:
return
'left'
return
'left'
case
'bottom'
:
return
'right'
case
'left'
:
case
'left'
:
return
'bottom'
return
'bottom'
case
'right'
:
case
'right'
:
...
@@ -459,7 +459,18 @@ export function getAnalyse(chart) {
...
@@ -459,7 +459,18 @@ export function getAnalyse(chart) {
if
(
chart
.
senior
&&
chart
.
type
&&
(
chart
.
type
.
includes
(
'bar'
)
||
chart
.
type
.
includes
(
'line'
)
||
chart
.
type
.
includes
(
'mix'
)))
{
if
(
chart
.
senior
&&
chart
.
type
&&
(
chart
.
type
.
includes
(
'bar'
)
||
chart
.
type
.
includes
(
'line'
)
||
chart
.
type
.
includes
(
'mix'
)))
{
senior
=
JSON
.
parse
(
chart
.
senior
)
senior
=
JSON
.
parse
(
chart
.
senior
)
if
(
senior
.
assistLine
&&
senior
.
assistLine
.
length
>
0
)
{
if
(
senior
.
assistLine
&&
senior
.
assistLine
.
length
>
0
)
{
const
customStyle
=
JSON
.
parse
(
chart
.
customStyle
)
let
xAxisPosition
,
yAxisPosition
if
(
customStyle
.
xAxis
)
{
const
a
=
JSON
.
parse
(
JSON
.
stringify
(
customStyle
.
xAxis
))
xAxisPosition
=
transAxisPosition
(
chart
,
a
)
}
if
(
customStyle
.
yAxis
)
{
const
a
=
JSON
.
parse
(
JSON
.
stringify
(
customStyle
.
yAxis
))
yAxisPosition
=
transAxisPosition
(
chart
,
a
)
}
senior
.
assistLine
.
forEach
(
ele
=>
{
senior
.
assistLine
.
forEach
(
ele
=>
{
const
content
=
ele
.
name
+
' : '
+
parseFloat
(
ele
.
value
)
assistLine
.
push
({
assistLine
.
push
({
type
:
'line'
,
type
:
'line'
,
start
:
[
'start'
,
parseFloat
(
ele
.
value
)],
start
:
[
'start'
,
parseFloat
(
ele
.
value
)],
...
@@ -469,18 +480,34 @@ export function getAnalyse(chart) {
...
@@ -469,18 +480,34 @@ export function getAnalyse(chart) {
lineDash
:
getLineDash
(
ele
.
lineType
)
lineDash
:
getLineDash
(
ele
.
lineType
)
}
}
})
})
assistLine
.
push
({
if
(
!
chart
.
type
.
includes
(
'horizontal'
))
{
type
:
'text'
,
assistLine
.
push
({
position
:
[
'start'
,
parseFloat
(
ele
.
value
)],
type
:
'text'
,
content
:
parseFloat
(
ele
.
value
),
position
:
[
yAxisPosition
===
'left'
?
'start'
:
'end'
,
parseFloat
(
ele
.
value
)],
offsetY
:
-
2
,
content
:
content
,
offsetX
:
2
,
offsetY
:
-
2
,
style
:
{
offsetX
:
yAxisPosition
===
'left'
?
2
:
-
10
*
(
content
.
length
-
2
),
textBaseline
:
'bottom'
,
style
:
{
fill
:
ele
.
color
,
textBaseline
:
'bottom'
,
fontSize
:
10
fill
:
ele
.
color
,
}
fontSize
:
10
})
}
})
}
else
{
assistLine
.
push
({
type
:
'text'
,
position
:
[
xAxisPosition
===
'left'
?
'start'
:
'end'
,
parseFloat
(
ele
.
value
)],
content
:
content
,
offsetY
:
xAxisPosition
===
'left'
?
-
2
:
-
10
*
(
content
.
length
-
2
),
offsetX
:
2
,
rotate
:
Math
.
PI
/
2
,
style
:
{
textBaseline
:
'bottom'
,
fill
:
ele
.
color
,
fontSize
:
10
}
})
}
})
})
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论