no message
Former-commit-id: 925469bd93cff92b2db7385736b12bff64526776 Former-commit-id: a5749cd7d535fcf87b78f059d0d6a2a88708a192 Former-commit-id: e4040dd7cf0881bc5cc6c715d6bfc4beadbc9ef1
This commit is contained in:
@@ -9,22 +9,6 @@ export default {
|
|||||||
mixins: [
|
mixins: [
|
||||||
G2
|
G2
|
||||||
],
|
],
|
||||||
// 公用参数在 G2 mixin 中
|
|
||||||
// 这个组件特有的参数添加在这里
|
|
||||||
props: {
|
|
||||||
// 横轴字段名
|
|
||||||
keyNameX: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: 'x'
|
|
||||||
},
|
|
||||||
// 纵轴字段名
|
|
||||||
keyNameY: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: 'y'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
init () {
|
init () {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ Mock.mock('/api/chart/G2Line', 'post', ({body, type, url}) => {
|
|||||||
case 'base': {
|
case 'base': {
|
||||||
let lastValue = 0
|
let lastValue = 0
|
||||||
const year = ['1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999']
|
const year = ['1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999']
|
||||||
const data = year.map(y => ({
|
const data = year.map(e => ({
|
||||||
year: y,
|
year: e,
|
||||||
value: 0
|
value: 0
|
||||||
})).map(e => {
|
})).map(e => {
|
||||||
e.value = lastValue + r()
|
e.value = lastValue + r()
|
||||||
@@ -31,8 +31,8 @@ Mock.mock('/api/chart/G2Line', 'post', ({body, type, url}) => {
|
|||||||
}
|
}
|
||||||
case 'step': {
|
case 'step': {
|
||||||
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
||||||
const data = month.map(y => ({
|
const data = month.map(e => ({
|
||||||
month: y,
|
month: e,
|
||||||
value: 0
|
value: 0
|
||||||
})).map(e => {
|
})).map(e => {
|
||||||
e.value = r()
|
e.value = r()
|
||||||
|
|||||||
Reference in New Issue
Block a user