no message

Former-commit-id: de8aba5aa8b239e2abba42684b43d3d93bc0f761
Former-commit-id: d2b379a92960a7a183040463a47e5fe551084f50
Former-commit-id: 0b6c1177a037a967d0619678d68620673787e770
This commit is contained in:
李杨
2018-02-19 12:15:42 +08:00
parent cac399ca34
commit cd2ba2e826
5 changed files with 67 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
<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)
this.chart.axis('x', {
label: {
offset: 12
}
})
this.chart.coord().transpose()
this.chart.interval().position('x*y')
// 渲染图表
this.chart.render()
},
// 数据源改变 重新渲染新的数据
changeData () {
this.chart.changeData(this.data)
}
}
}
</script>

View File

@@ -1,5 +1,7 @@
import Vue from 'vue'
Vue.component('G2AreaBase', resolve => { require(['@/components/charts/G2/components/Area/base.vue'], resolve) })
Vue.component('G2BarBase', resolve => { require(['@/components/charts/G2/components/Bar/base.vue'], resolve) })
Vue.component('G2ColumnBase', resolve => { require(['@/components/charts/G2/components/Column/base.vue'], resolve) })