Giter Site home page Giter Site logo

vue3-echarts's Introduction

vue3-echarts

npm

Echarts binding for Vue 3

How to use

  1. Install

    yarn add vue3-echarts
  2. Register it in components of Vue options

    import { VueEcharts } from 'vue3-echarts';
    
    export default {
        data,
        methods,
        ...
        components: {
            VueEcharts,
        },
    }
  3. Use the component in template

    <vue-echarts :option="option" style="height: 500px" ref="chart" />

    prop option is required

    (this.$refs.chart as VueEcharts).refreshOption();

    Note: vue-echarts has no height by default. You need to specify it manually. DOM size change is detected automatically using ResizeObserver, no manual resize call needed.

Props

option

Type: object

Echarts option. Documents can be found here: https://echarts.apache.org/en/option.html#title. If null, loading animation will be shown

theme

Type: string Default: default

Theme used, should be pre-registered using echarts.registerTheme

groupId

Type: number

Group name to be used in chart connection

loadingOption

Config used by showLoading.

Loading animation will be shown automatically when option is null or an empty object.

initCfg

Other configuration used by echarts.init

Methods

refreshOption

Refresh option using setOption. If option is null or an empty object, loading animation will be shown. See loadingOption

refreshChart

Recreate echarts instance

setOption

Alias of echartsInstance.setOption

dispatchAction

Alias of echartsInstance.dispatchAction

events

All echarts events are supported. Doc can be found here: https://echarts.apache.org/en/api.html#events

LICENSE

MIT

vue3-echarts's People

Contributors

carterli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.