no message

Former-commit-id: 873a2afd2881efe54dbdc525de801e5062d4fa36
Former-commit-id: dbe6c982d002cc37d1a90ff15773390f1202d058
Former-commit-id: 868b1fd3d94060ac719b84be9a4f1c2e5087a959
This commit is contained in:
李杨
2018-01-29 17:34:33 +08:00
parent fbe0e17ae6
commit 0894e110c8
6 changed files with 19 additions and 27 deletions

View File

@@ -19,12 +19,7 @@ export default {
methods: {
// 初始化图表
initHandler () {
this.chart = new this.G2.Chart({
container: this.$refs.chart,
forceFit: this.forceFit,
height: this.G2.DomUtil.getHeight(this.$refs.chart),
padding: this.padding
})
this.creatChart()
this.chart.source(this.data)
this.chart.scale('sales', {
tickInterval: 20

View File

@@ -19,12 +19,7 @@ export default {
methods: {
// 初始化图表
initHandler () {
this.chart = new this.G2.Chart({
container: this.$refs.chart,
forceFit: this.forceFit,
height: this.G2.DomUtil.getHeight(this.$refs.chart),
padding: this.padding
})
this.creatChart()
this.chart.source(this.data)
this.chart.scale('value', {
min: 0

View File

@@ -29,12 +29,7 @@ export default {
},
// 初始化图表
initHandler () {
this.chart = new this.G2.Chart({
container: this.$refs.chart,
forceFit: this.forceFit,
height: this.G2.DomUtil.getHeight(this.$refs.chart),
padding: this.padding
})
this.creatChart()
this.chart.source(this.dvMaker(), {
percent: {
formatter: val => {

View File

@@ -59,6 +59,15 @@ export default {
}
},
methods: {
// 创建图表对象
creatChart () {
this.chart = new this.G2.Chart({
container: this.$refs.chart,
forceFit: this.forceFit,
height: this.G2.DomUtil.getHeight(this.$refs.chart),
padding: this.padding
})
},
// 重绘大小
resize (width, height) {
if (this.chart) {

View File

@@ -8,14 +8,12 @@ Mock.mock('/api/chart/G2Column', 'post', ({body, type, url}) => {
code: 0,
msg: '请求成功',
data: [
{ year: '1951', sales: 38 },
{ year: '1952', sales: 52 },
{ year: '1956', sales: 61 },
{ year: '1957', sales: 145 },
{ year: '1958', sales: 48 },
{ year: '1959', sales: 38 },
{ year: '1960 年', sales: 38 },
{ year: '1962 年', sales: 38 }
{ year: '1951', sales: 38 },
{ year: '1952', sales: 52 },
{ year: '1956', sales: 61 },
{ year: '1957', sales: 145 },
{ year: '1958', sales: 48 },
{ year: '1959', sales: 38 }
]
}
default:

View File

@@ -5,7 +5,7 @@ export default {
layout: [
{'x': 0, 'y': 0, 'w': 8, 'h': 9, 'i': '0'},
{'x': 8, 'y': 0, 'w': 4, 'h': 9, 'i': '1'},
{'x': 0, 'y': 9, 'w': 5, 'h': 7, 'i': '2'}
{'x': 0, 'y': 9, 'w': 4, 'h': 7, 'i': '2'}
],
colNum: 12,
rowHeight: 30,