no message

Former-commit-id: 759d9fc30b3577fa407465d9bce11b1894cd1827
Former-commit-id: c01f76e995b3a94ebed8c6485978f04f1f312b24
Former-commit-id: ddcd4da77f33fb0330afebe837e3fadd15f44595
This commit is contained in:
李杨
2018-02-19 12:20:36 +08:00
parent cd2ba2e826
commit c21ffa52e0
3 changed files with 25 additions and 8 deletions

View File

@@ -16,13 +16,21 @@ export default {
this.creatChart()
// 本组件的特殊设置
this.chart.source(this.data)
this.chart.axis('x', {
label: {
offset: 12
this.chart.scale({
y: {
min: 0
},
x: {
range: [0, 1]
}
})
this.chart.coord().transpose()
this.chart.interval().position('x*y')
this.chart.tooltip({
crosshairs: {
type: 'line'
}
})
this.chart.area().position('x*y')
this.chart.line().position('x*y').size(2)
// 渲染图表
this.chart.render()
},

View File

@@ -6,7 +6,17 @@ Mock.mock('/api/chart/G2Area', 'post', ({body, type, url}) => {
switch (_body.type) {
// 基础折线图
case 'base': {
return fn.returnMaker(['3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'].map(x => ({x, y: fn.r()})))
let last = 0
const data = ['3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'].map(x => ({
x,
y: 0
})).map(e => {
e.y = last + fn.r()
last = e.y
return e
})
last = 0
return fn.returnMaker(data)
}
default:
return {}

View File

@@ -111,8 +111,7 @@ export default {
{
api: {url: '/api/chart/G2Area', data: {type: 'base'}},
refName: 'G2AreaBase',
data: [],
padding: [30, 30, 30, 30]
data: []
}
],
layout: {