mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-14 19:23:28 +08:00
refactor demo
This commit is contained in:
@ -12,7 +12,8 @@
|
|||||||
<p v-if="seconds"><small>Data coming in <b>{{seconds}}</b> second{{seconds > 1 ? 's' : ''}}...</small></p>
|
<p v-if="seconds"><small>Data coming in <b>{{seconds}}</b> second{{seconds > 1 ? 's' : ''}}...</small></p>
|
||||||
<p v-else><small>Ready.</small></p>
|
<p v-else><small>Ready.</small></p>
|
||||||
</template>
|
</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>
|
<h2>Pie chart <small>(with action dispatch)</small></h2>
|
||||||
<chart :options="pie" ref="pie" auto-resize></chart>
|
<chart :options="pie" ref="pie" auto-resize></chart>
|
||||||
@ -165,12 +166,28 @@ body .echarts {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ECharts from '../src/components/ECharts.vue'
|
||||||
import bar from './data/bar'
|
import bar from './data/bar'
|
||||||
import pie from './data/pie'
|
import pie from './data/pie'
|
||||||
import polar from './data/polar'
|
import polar from './data/polar'
|
||||||
import map from './data/map'
|
import map from './data/map'
|
||||||
import logo from 'raw!./assets/Vue-ECharts.svg'
|
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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,22 +2,9 @@ import Vue from 'vue'
|
|||||||
import ECharts from '../src/components/ECharts.vue'
|
import ECharts from '../src/components/ECharts.vue'
|
||||||
import Demo from './Demo.vue'
|
import Demo from './Demo.vue'
|
||||||
|
|
||||||
// built-in theme
|
// registering component
|
||||||
import 'echarts/theme/dark'
|
|
||||||
|
|
||||||
import chinaMap from './china.json'
|
|
||||||
|
|
||||||
// custom theme
|
|
||||||
import theme from './theme.json'
|
|
||||||
|
|
||||||
Vue.component('chart', ECharts)
|
Vue.component('chart', ECharts)
|
||||||
|
|
||||||
// registering map data
|
|
||||||
ECharts.registerMap('china', chinaMap)
|
|
||||||
|
|
||||||
// registering custom theme
|
|
||||||
ECharts.registerTheme('vue-echarts', theme)
|
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#demo',
|
el: '#demo',
|
||||||
components: {
|
components: {
|
||||||
|
Reference in New Issue
Block a user