no message

Former-commit-id: 84650508814baf1791d8b29472b88eddecfc3660
Former-commit-id: c03e89464e3d3c3cde9a42db8e7447744bcb7e90
Former-commit-id: 9e4184577b6ad94dfaa909bd08fd28aac21371e5
This commit is contained in:
李杨
2018-01-29 14:30:53 +08:00
parent a07663930f
commit bb33401182
4 changed files with 11 additions and 26 deletions

View File

@@ -8,6 +8,12 @@ export default {
mixins: [
G2Mixin
],
data () {
return {
// [图表设置项] padding
padding: [30, 40, 50, 50]
}
},
methods: {
// 初始化图表
initHandler () {
@@ -17,18 +23,6 @@ export default {
height: this.G2.DomUtil.getHeight(this.$refs.chart),
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.scale('value', {
min: 0

View File

@@ -17,24 +17,12 @@ export default {
required: false,
default: true
},
// [图表设置项] 标题
title: {
type: String,
required: false,
default: ''
},
// [图表设置项] 高度
height: {
type: Number,
required: false,
default: 300
},
// [图表设置项] padding
padding: {
type: Array,
required: false,
default: () => [50, 50, 50, 50]
},
// [图表设置项] 开启自动填充父元素高度
autoHeight: {
type: Boolean,
@@ -55,7 +43,9 @@ export default {
// 数据处理模块
dataSet,
// 图表实例
chart: null
chart: null,
// [图表设置项] padding
padding: [40, 40, 40, 40]
}
},
mounted () {