no message
Former-commit-id: 84650508814baf1791d8b29472b88eddecfc3660 Former-commit-id: c03e89464e3d3c3cde9a42db8e7447744bcb7e90 Former-commit-id: 9e4184577b6ad94dfaa909bd08fd28aac21371e5
This commit is contained in:
@@ -8,6 +8,12 @@ export default {
|
|||||||
mixins: [
|
mixins: [
|
||||||
G2Mixin
|
G2Mixin
|
||||||
],
|
],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
// [图表设置项] padding
|
||||||
|
padding: [30, 40, 50, 50]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
initHandler () {
|
initHandler () {
|
||||||
@@ -17,18 +23,6 @@ export default {
|
|||||||
height: this.G2.DomUtil.getHeight(this.$refs.chart),
|
height: this.G2.DomUtil.getHeight(this.$refs.chart),
|
||||||
padding: this.padding
|
padding: this.padding
|
||||||
})
|
})
|
||||||
this.chart.guide().text({
|
|
||||||
top: true,
|
|
||||||
position: ['min', 'max'],
|
|
||||||
content: this.title,
|
|
||||||
style: {
|
|
||||||
fill: '#666', // 文本颜色
|
|
||||||
fontSize: '16', // 文本大小
|
|
||||||
fontWeight: 'bold' // 文本粗细
|
|
||||||
},
|
|
||||||
offsetX: 0,
|
|
||||||
offsetY: 0
|
|
||||||
})
|
|
||||||
this.chart.source(this.data)
|
this.chart.source(this.data)
|
||||||
this.chart.scale('value', {
|
this.chart.scale('value', {
|
||||||
min: 0
|
min: 0
|
||||||
|
|||||||
@@ -17,24 +17,12 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
// [图表设置项] 标题
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
// [图表设置项] 高度
|
// [图表设置项] 高度
|
||||||
height: {
|
height: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 300
|
default: 300
|
||||||
},
|
},
|
||||||
// [图表设置项] padding
|
|
||||||
padding: {
|
|
||||||
type: Array,
|
|
||||||
required: false,
|
|
||||||
default: () => [50, 50, 50, 50]
|
|
||||||
},
|
|
||||||
// [图表设置项] 开启自动填充父元素高度
|
// [图表设置项] 开启自动填充父元素高度
|
||||||
autoHeight: {
|
autoHeight: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -55,7 +43,9 @@ export default {
|
|||||||
// 数据处理模块
|
// 数据处理模块
|
||||||
dataSet,
|
dataSet,
|
||||||
// 图表实例
|
// 图表实例
|
||||||
chart: null
|
chart: null,
|
||||||
|
// [图表设置项] padding
|
||||||
|
padding: [40, 40, 40, 40]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<GridLayout v-bind="layout">
|
<GridLayout v-bind="layout">
|
||||||
<GridItem v-bind="layout.layout[0]" @resize="resizeHandler('G2Line1')" @resized="resizedHandler('G2Line1')">
|
<GridItem v-bind="layout.layout[0]" @resize="resizeHandler('G2Line1')" @resized="resizedHandler('G2Line1')">
|
||||||
<el-card>
|
<el-card>
|
||||||
|
<div slot="header">近年趋势</div>
|
||||||
<G2Line1
|
<G2Line1
|
||||||
ref="G2Line1"
|
ref="G2Line1"
|
||||||
:data="G2Line1"
|
:data="G2Line1"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
@extend %unable-select;
|
@extend %unable-select;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.el-card__body {
|
.el-card__body {
|
||||||
height: 100%;
|
height: calc(100% - 59px);
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user