no message

Former-commit-id: 925469bd93cff92b2db7385736b12bff64526776
Former-commit-id: a5749cd7d535fcf87b78f059d0d6a2a88708a192
Former-commit-id: e4040dd7cf0881bc5cc6c715d6bfc4beadbc9ef1
This commit is contained in:
李杨
2018-02-18 11:46:15 +08:00
parent c7f2f31980
commit 414d984dce
2 changed files with 4 additions and 20 deletions

View File

@@ -9,22 +9,6 @@ export default {
mixins: [
G2
],
// 公用参数在 G2 mixin 中
// 这个组件特有的参数添加在这里
props: {
// 横轴字段名
keyNameX: {
type: String,
required: false,
default: 'x'
},
// 纵轴字段名
keyNameY: {
type: String,
required: false,
default: 'y'
}
},
methods: {
// 初始化图表
init () {

View File

@@ -18,8 +18,8 @@ Mock.mock('/api/chart/G2Line', 'post', ({body, type, url}) => {
case 'base': {
let lastValue = 0
const year = ['1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999']
const data = year.map(y => ({
year: y,
const data = year.map(e => ({
year: e,
value: 0
})).map(e => {
e.value = lastValue + r()
@@ -31,8 +31,8 @@ Mock.mock('/api/chart/G2Line', 'post', ({body, type, url}) => {
}
case 'step': {
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
const data = month.map(y => ({
month: y,
const data = month.map(e => ({
month: e,
value: 0
})).map(e => {
e.value = r()