no message
Former-commit-id: 511753a92afc6b4e155dd92c08a769a45e6bff95 Former-commit-id: f75b803d390be369bf7ddd532efeafe6f65b4f4b Former-commit-id: 930e77ed313f139b66cae13179bb677f88f2f8c9
This commit is contained in:
@@ -32,6 +32,7 @@ export default {
|
||||
stroke: '#fff',
|
||||
lineWidth: 1
|
||||
})
|
||||
// 渲染图表
|
||||
this.chart.render()
|
||||
},
|
||||
// 数据源改变 重新渲染新的数据
|
||||
|
||||
33
src/components/charts/G2/components/Line/step.vue
Normal file
33
src/components/charts/G2/components/Line/step.vue
Normal 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>
|
||||
@@ -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) })
|
||||
|
||||
Reference in New Issue
Block a user