no message

Former-commit-id: 511753a92afc6b4e155dd92c08a769a45e6bff95
Former-commit-id: f75b803d390be369bf7ddd532efeafe6f65b4f4b
Former-commit-id: 930e77ed313f139b66cae13179bb677f88f2f8c9
This commit is contained in:
李杨
2018-02-18 11:25:24 +08:00
parent 873233943b
commit 7317d13d7f
8 changed files with 62 additions and 62 deletions

View File

@@ -32,6 +32,7 @@ export default {
stroke: '#fff',
lineWidth: 1
})
// 渲染图表
this.chart.render()
},
// 数据源改变 重新渲染新的数据

View File

@@ -0,0 +1,33 @@
<template>
<!-- 如果需要开启自动高度功能 需要在这里设置 style="height: 100%;" -->
<div ref="chart" style="height: 100%;"></div>
</template>
<script>
import G2 from '@/components/charts/G2/mixins/G2.js'
export default {
mixins: [
G2
],
methods: {
// 初始化图表
init () {
// mixin 中提供 creatChart
this.creatChart()
// 本组件的特殊设置
this.chart.source(this.data, {
month: {
range: [0, 1]
}
})
this.chart.line().position('month*value').shape('hv')
// 渲染图表
this.chart.render()
},
// 数据源改变 重新渲染新的数据
changeData () {
this.chart.changeData(this.data)
}
}
}
</script>

View File

@@ -1,3 +1,4 @@
import Vue from 'vue'
Vue.component('G2LineBase', resolve => { require(['@/components/charts/G2/components/Line/base.vue'], resolve) })
Vue.component('G2LineStep', resolve => { require(['@/components/charts/G2/components/Line/step.vue'], resolve) })