0.1.1 • Published 5 years ago

vue-echarts-ts v0.1.1

Weekly downloads
72
License
MIT
Repository
github
Last release
5 years ago

vue-echarts-ts

Vue custom component based on Vue2.x and Echarts with typescript

Features

  • Vue echarts component: Can directly be used in vue-typescirpt project as a custom component.Has already completed echarts instance initiation and handled window resizing.Can operate echarts instance to dispatch actions and other.
  • Typescript supported: Developed and exported with typescript.Support @types/echarts definitions.

Install

npm i vue-echarts-ts

Init

import Vue from 'vue';
import VueEcharts from 'vue-echarts-ts';

Vue.use(VueEcharts);

SimpleUse

<template>
  <div class="home">
    <VueEcharts :option="option" :ei.sync="ei"></VueEcharts>
    <button @click="dipatchAction()">Dispatch</button>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";

@Component
export default class Home extends Vue {
  private option = {
    series: [
      {
        type: "pie",
        data: [{ name: "cat", value: 100 }, { name: "dog", value: 180 }]
      }
    ]
  };
  private ei: any | ECharts = {};
  private dipatchAction() {
    this.ei.dispatchAction({
      type: "pieSelect",
      name: "cat"
    });
  }
}
</script>

Document

License

MIT

Support

Modern browsers and Internet Explorer 10+, include pc and mobile browser.

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago