Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
a90de21b
Unverified
提交
a90de21b
authored
9月 03, 2021
作者:
XiaJunjie2020
提交者:
GitHub
9月 03, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #758 from dataease/pr@dev@feat_axis_value
feat(视图): 坐标轴轴值设置
上级
6bd2c603
80d63390
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
121 行增加
和
4 行删除
+121
-4
en.js
frontend/src/lang/en.js
+6
-1
tw.js
frontend/src/lang/tw.js
+6
-1
zh.js
frontend/src/lang/zh.js
+6
-1
chart.js
frontend/src/views/chart/chart/chart.js
+12
-0
common.js
frontend/src/views/chart/chart/common/common.js
+24
-0
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+1
-1
XAxisSelector.vue
.../views/chart/components/component-style/XAxisSelector.vue
+33
-0
YAxisSelector.vue
.../views/chart/components/component-style/YAxisSelector.vue
+33
-0
没有找到文件。
frontend/src/lang/en.js
浏览文件 @
a90de21b
...
...
@@ -849,7 +849,12 @@ export default {
custom_case
:
'Custom'
,
last_layer
:
'This Is The Last Layer'
,
radar_size
:
'Size'
,
chart_mix
:
'Mix'
chart_mix
:
'Mix'
,
axis_value
:
'Axis Value'
,
axis_value_min
:
'Min'
,
axis_value_max
:
'Max'
,
axis_value_split
:
'Split'
,
axis_auto
:
'Auto'
},
dataset
:
{
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
a90de21b
...
...
@@ -848,7 +848,12 @@ export default {
custom_case
:
'自定義'
,
last_layer
:
'當前已經是最後一級'
,
radar_size
:
'大小'
,
chart_mix
:
'組合圖'
chart_mix
:
'組合圖'
,
axis_value
:
'軸值'
,
axis_value_min
:
'最小值'
,
axis_value_max
:
'最大值'
,
axis_value_split
:
'間隔'
,
axis_auto
:
'自動'
},
dataset
:
{
sheet_warn
:
'有多個sheet頁面,默認抽取第一個'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
a90de21b
...
...
@@ -848,7 +848,12 @@ export default {
custom_case
:
'自定义'
,
last_layer
:
'当前已经是最后一级'
,
radar_size
:
'大小'
,
chart_mix
:
'组合图'
chart_mix
:
'组合图'
,
axis_value
:
'轴值'
,
axis_value_min
:
'最小值'
,
axis_value_max
:
'最大值'
,
axis_value_split
:
'间隔'
,
axis_auto
:
'自动'
},
dataset
:
{
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
...
...
frontend/src/views/chart/chart/chart.js
浏览文件 @
a90de21b
...
...
@@ -107,6 +107,12 @@ export const DEFAULT_XAXIS_STYLE = {
width
:
1
,
style
:
'solid'
}
},
axisValue
:
{
auto
:
true
,
min
:
null
,
max
:
null
,
split
:
null
}
}
export
const
DEFAULT_YAXIS_STYLE
=
{
...
...
@@ -131,6 +137,12 @@ export const DEFAULT_YAXIS_STYLE = {
width
:
1
,
style
:
'solid'
}
},
axisValue
:
{
auto
:
true
,
min
:
null
,
max
:
null
,
split
:
null
}
}
export
const
DEFAULT_BACKGROUND_COLOR
=
{
...
...
frontend/src/views/chart/chart/common/common.js
浏览文件 @
a90de21b
...
...
@@ -65,6 +65,18 @@ export function componentStyle(chart_option, chart) {
if
(
!
customStyle
.
xAxis
.
show
)
{
chart_option
.
xAxis
.
axisLabel
.
show
=
false
}
// 轴值设置
delete
chart_option
.
xAxis
.
min
delete
chart_option
.
xAxis
.
max
delete
chart_option
.
xAxis
.
split
if
(
chart
.
type
.
includes
(
'horizontal'
))
{
if
(
customStyle
.
xAxis
.
axisValue
&&
!
customStyle
.
xAxis
.
axisValue
.
auto
)
{
customStyle
.
xAxis
.
axisValue
.
min
&&
(
chart_option
.
xAxis
.
min
=
parseFloat
(
customStyle
.
xAxis
.
axisValue
.
min
))
customStyle
.
xAxis
.
axisValue
.
max
&&
(
chart_option
.
xAxis
.
max
=
parseFloat
(
customStyle
.
xAxis
.
axisValue
.
max
))
customStyle
.
xAxis
.
axisValue
.
split
&&
(
chart_option
.
xAxis
.
interval
=
parseFloat
(
customStyle
.
xAxis
.
axisValue
.
split
))
}
}
}
if
(
customStyle
.
yAxis
&&
(
chart
.
type
.
includes
(
'bar'
)
||
chart
.
type
.
includes
(
'line'
)
||
chart
.
type
.
includes
(
'scatter'
)
||
chart
.
type
===
'chart-mix'
))
{
chart_option
.
yAxis
.
show
=
customStyle
.
yAxis
.
show
...
...
@@ -80,6 +92,18 @@ export function componentStyle(chart_option, chart) {
if
(
!
customStyle
.
yAxis
.
show
)
{
chart_option
.
yAxis
.
axisLabel
.
show
=
false
}
// 轴值设置
delete
chart_option
.
yAxis
.
min
delete
chart_option
.
yAxis
.
max
delete
chart_option
.
yAxis
.
split
if
(
!
chart
.
type
.
includes
(
'horizontal'
))
{
if
(
customStyle
.
yAxis
.
axisValue
&&
!
customStyle
.
yAxis
.
axisValue
.
auto
)
{
customStyle
.
yAxis
.
axisValue
.
min
&&
(
chart_option
.
yAxis
.
min
=
parseFloat
(
customStyle
.
yAxis
.
axisValue
.
min
))
customStyle
.
yAxis
.
axisValue
.
max
&&
(
chart_option
.
yAxis
.
max
=
parseFloat
(
customStyle
.
yAxis
.
axisValue
.
max
))
customStyle
.
yAxis
.
axisValue
.
split
&&
(
chart_option
.
yAxis
.
interval
=
parseFloat
(
customStyle
.
yAxis
.
axisValue
.
split
))
}
}
}
if
(
customStyle
.
split
&&
chart
.
type
.
includes
(
'radar'
))
{
chart_option
.
radar
.
name
=
customStyle
.
split
.
name
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
a90de21b
...
...
@@ -155,7 +155,7 @@ export default {
}
else
if
(
chart
.
type
===
'chart-mix'
)
{
chart_option
=
baseMixOption
(
JSON
.
parse
(
JSON
.
stringify
(
BASE_MIX
)),
chart
)
}
console
.
log
(
JSON
.
stringify
(
chart_option
))
//
console.log(JSON.stringify(chart_option))
if
(
chart
.
type
===
'map'
)
{
const
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
...
...
frontend/src/views/chart/components/component-style/XAxisSelector.vue
浏览文件 @
a90de21b
...
...
@@ -23,6 +23,36 @@
<el-option
v-for=
"option in fontSize"
:key=
"option.value"
:label=
"option.name"
:value=
"option.value"
/>
</el-select>
</el-form-item>
<span
v-show=
"chart.type && chart.type.includes('horizontal')"
>
<el-divider
/>
<el-form-item
class=
"form-item"
>
<span
slot=
"label"
>
<span
class=
"span-box"
>
<span>
{{
$t
(
'chart.axis_value'
)
}}
</span>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"bottom"
>
<div
slot=
"content"
>
最小值、最大值、间隔均为数值类型;若不填,则该项视为自动。
<br>
请确保填写数值能正确计算,否则将无法正常显示轴值。
</div>
<i
class=
"el-icon-info"
style=
"cursor: pointer;"
/>
</el-tooltip>
</span>
</span>
<el-checkbox
v-model=
"axisForm.axisValue.auto"
@
change=
"changeXAxisStyle"
>
{{
$t
(
'chart.axis_auto'
)
}}
</el-checkbox>
</el-form-item>
<span
v-show=
"!axisForm.axisValue.auto"
>
<el-form-item
:label=
"$t('chart.axis_value_min')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.min"
@
blur=
"changeXAxisStyle"
/>
</el-form-item>
<el-form-item
:label=
"$t('chart.axis_value_max')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.max"
@
blur=
"changeXAxisStyle"
/>
</el-form-item>
<el-form-item
:label=
"$t('chart.axis_value_split')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.split"
@
blur=
"changeXAxisStyle"
/>
</el-form-item>
</span>
</span>
<el-divider
/>
<el-form-item
:label=
"$t('chart.axis_show')"
class=
"form-item"
>
<el-checkbox
v-model=
"axisForm.splitLine.show"
@
change=
"changeXAxisStyle"
>
{{
$t
(
'chart.axis_show'
)
}}
</el-checkbox>
...
...
@@ -120,6 +150,9 @@ export default {
if
(
!
this
.
axisForm
.
nameTextStyle
)
{
this
.
axisForm
.
nameTextStyle
=
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_XAXIS_STYLE
.
nameTextStyle
))
}
if
(
!
this
.
axisForm
.
axisValue
)
{
this
.
axisForm
.
axisValue
=
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_XAXIS_STYLE
.
axisValue
))
}
}
}
},
...
...
frontend/src/views/chart/components/component-style/YAxisSelector.vue
浏览文件 @
a90de21b
...
...
@@ -23,6 +23,36 @@
<el-option
v-for=
"option in fontSize"
:key=
"option.value"
:label=
"option.name"
:value=
"option.value"
/>
</el-select>
</el-form-item>
<span
v-show=
"chart.type && !chart.type.includes('horizontal')"
>
<el-divider
/>
<el-form-item
class=
"form-item"
>
<span
slot=
"label"
>
<span
class=
"span-box"
>
<span>
{{
$t
(
'chart.axis_value'
)
}}
</span>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"bottom"
>
<div
slot=
"content"
>
最小值、最大值、间隔均为数值类型;若不填,则该项视为自动。
<br>
请确保填写数值能正确计算,否则将无法正常显示轴值。
</div>
<i
class=
"el-icon-info"
style=
"cursor: pointer;"
/>
</el-tooltip>
</span>
</span>
<el-checkbox
v-model=
"axisForm.axisValue.auto"
@
change=
"changeYAxisStyle"
>
{{
$t
(
'chart.axis_auto'
)
}}
</el-checkbox>
</el-form-item>
<span
v-show=
"!axisForm.axisValue.auto"
>
<el-form-item
:label=
"$t('chart.axis_value_min')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.min"
@
blur=
"changeYAxisStyle"
/>
</el-form-item>
<el-form-item
:label=
"$t('chart.axis_value_max')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.max"
@
blur=
"changeYAxisStyle"
/>
</el-form-item>
<el-form-item
:label=
"$t('chart.axis_value_split')"
class=
"form-item"
>
<el-input
v-model=
"axisForm.axisValue.split"
@
blur=
"changeYAxisStyle"
/>
</el-form-item>
</span>
</span>
<el-divider
/>
<el-form-item
:label=
"$t('chart.axis_show')"
class=
"form-item"
>
<el-checkbox
v-model=
"axisForm.splitLine.show"
@
change=
"changeYAxisStyle"
>
{{
$t
(
'chart.axis_show'
)
}}
</el-checkbox>
...
...
@@ -120,6 +150,9 @@ export default {
if
(
!
this
.
axisForm
.
nameTextStyle
)
{
this
.
axisForm
.
nameTextStyle
=
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_YAXIS_STYLE
.
nameTextStyle
))
}
if
(
!
this
.
axisForm
.
axisValue
)
{
this
.
axisForm
.
axisValue
=
JSON
.
parse
(
JSON
.
stringify
(
DEFAULT_YAXIS_STYLE
.
axisValue
))
}
}
}
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论