refactor demo

This commit is contained in:
Justineo
2017-01-10 11:47:52 +08:00
parent 4db9294afe
commit 307148592d
3 changed files with 41 additions and 37 deletions

View File

@ -12,7 +12,8 @@
<p v-if="seconds"><small>Data coming in <b>{{seconds}}</b> second{{seconds > 1 ? 's' : ''}}...</small></p>
<p v-else><small>Ready.</small></p>
</template>
<chart :options="bar" ref="bar" theme="vue-echarts" auto-resize></chart>
<chart :options="bar" ref="bar" theme="ovilia-green" auto-resize></chart>
<p><small>(Theme Ovilia-Green)</small></p>
<h2>Pie chart <small>(with action dispatch)</small></h2>
<chart :options="pie" ref="pie" auto-resize></chart>
@ -165,12 +166,28 @@ body .echarts {
</style>
<script>
import ECharts from '../src/components/ECharts.vue'
import bar from './data/bar'
import pie from './data/pie'
import polar from './data/polar'
import map from './data/map'
import logo from 'raw!./assets/Vue-ECharts.svg'
// built-in theme
import 'echarts/theme/dark'
// custom theme
import theme from './theme.json'
// Map of China
import chinaMap from './china.json'
// registering map data
ECharts.registerMap('china', chinaMap)
// registering custom theme
ECharts.registerTheme('ovilia-green', theme)
export default {
data() {
return {

File diff suppressed because one or more lines are too long

View File

@ -2,22 +2,9 @@ import Vue from 'vue'
import ECharts from '../src/components/ECharts.vue'
import Demo from './Demo.vue'
// built-in theme
import 'echarts/theme/dark'
import chinaMap from './china.json'
// custom theme
import theme from './theme.json'
// registering component
Vue.component('chart', ECharts)
// registering map data
ECharts.registerMap('china', chinaMap)
// registering custom theme
ECharts.registerTheme('vue-echarts', theme)
new Vue({
el: '#demo',
components: {