All Projects → xlsdg → Vue Echarts V3

xlsdg / Vue Echarts V3

Licence: mit
Vue.js(v2.x+) component wrap for ECharts.js(v3.x+)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Echarts V3

React Echarts V3
React.js(v16.x+) component wrap for ECharts.js(v3.x+)
Stars: ✭ 48 (-94.57%)
Mutual labels:  library, chart, echarts
datart
Datart is a next generation Data Visualization Open Platform
Stars: ✭ 1,042 (+17.87%)
Mutual labels:  chart, echarts
Orcharts
饼状图、环形图、扇形图、曲线图、折线图
Stars: ✭ 125 (-85.86%)
Mutual labels:  library, chart
Timesheet.js
JavaScript library for HTML5 & CSS3 time sheets
Stars: ✭ 6,881 (+678.39%)
Mutual labels:  library, chart
Echarts Php
Echarts-PHP a PHP library that works as a wrapper for the Echarts js library
Stars: ✭ 253 (-71.38%)
Mutual labels:  chart, echarts
Timeline Chart View
An android view to represent data over a timeline.
Stars: ✭ 100 (-88.69%)
Mutual labels:  library, chart
Sparklinelayout
Simple and lightweight library for drawing sparklines / graphs. Support markers and gradients.
Stars: ✭ 291 (-67.08%)
Mutual labels:  library, chart
Vue Tiny Code
这里有一个仿 Chrome 调色盘,有一个拖动排版的页面,还有一些新奇的小点子。
Stars: ✭ 170 (-80.77%)
Mutual labels:  vue-component, echarts
Angular Echarts
💹 angularjs bindings for baidu echarts
Stars: ✭ 367 (-58.48%)
Mutual labels:  chart, echarts
Androidplot
Charts and plots for Android
Stars: ✭ 381 (-56.9%)
Mutual labels:  library, chart
Flutter echarts
A Flutter widget to use Apache ECharts (incubating) in a reactive way.
Stars: ✭ 420 (-52.49%)
Mutual labels:  chart, echarts
Vue Trend Chart
Simple trend charts for Vue.js
Stars: ✭ 216 (-75.57%)
Mutual labels:  chart, vue-component
React Component Echarts
React component echarts. 组件式百度图表。
Stars: ✭ 175 (-80.2%)
Mutual labels:  chart, echarts
Echarts For Vue
📊📈 ECharts wrapper component for Vue 3 and 2
Stars: ✭ 42 (-95.25%)
Mutual labels:  chart, echarts
Echarts For Weixin
Apache ECharts (incubating) 的微信小程序版本
Stars: ✭ 5,479 (+519.8%)
Mutual labels:  chart, echarts
vue-g2
基于 Vue 和 AntV/G2 的可视化组件库 📈
Stars: ✭ 73 (-91.74%)
Mutual labels:  chart, vue-component
Vue Tree Chart
A vue2 component to display tree chart
Stars: ✭ 351 (-60.29%)
Mutual labels:  chart, vue-component
Esp Dash
A blazing fast library to create a functional dashboard for ESP8266 and ESP32
Stars: ✭ 548 (-38.01%)
Mutual labels:  library, chart
Wunderbar
Simple horizontal bar chart printer for your terminal
Stars: ✭ 572 (-35.29%)
Mutual labels:  library, chart
Idutf8lib
Idiot's UTF-8 Library
Stars: ✭ 12 (-98.64%)
Mutual labels:  library

vue-echarts-v3 npm vue2 echarts3

Vue.js v2.x+ component wrap for Apache ECharts (incubating) v3.x+

Feature

  1. Lightweight, efficient, on-demand binding events;
  2. Support for importing ECharts.js charts and components on demand;
  3. Support component resize event auto update view;

Installation

$ npm install --save echarts vue-echarts-v3

Usage

  1. Change webpack config

    For webpack 1.x:

          {
            test: /\.js$/,
            loader: 'babel',
            include: [
    -          path.join(prjRoot, 'src')
    +          path.join(prjRoot, 'src'),
    +          path.join(prjRoot, 'node_modules/vue-echarts-v3/src')
            ],
    -        exclude: /node_modules/
    +        exclude: /node_modules(?![\\/]vue-echarts-v3[\\/]src[\\/])/
          },
    

    For webpack 2.x+:

          {
            test: /\.js$/,
            loader: 'babel-loader',
    -       include: [resolve('src'), resolve('test')]
    +       include: [resolve('src'), resolve('test'), resolve('node_modules/vue-echarts-v3/src')]
          }
    
  2. Import all charts and components

    import IEcharts from 'vue-echarts-v3/src/full.js';
    
  3. Import ECharts.js modules manually to reduce bundle size

    import IEcharts from 'vue-echarts-v3/src/lite.js';
    
    // import 'echarts/lib/chart/line';
    import 'echarts/lib/chart/bar';
    // import 'echarts/lib/chart/pie';
    // import 'echarts/lib/chart/scatter';
    // import 'echarts/lib/chart/radar';
    
    // import 'echarts/lib/chart/map';
    // import 'echarts/lib/chart/treemap';
    // import 'echarts/lib/chart/graph';
    // import 'echarts/lib/chart/gauge';
    // import 'echarts/lib/chart/funnel';
    // import 'echarts/lib/chart/parallel';
    // import 'echarts/lib/chart/sankey';
    // import 'echarts/lib/chart/boxplot';
    // import 'echarts/lib/chart/candlestick';
    // import 'echarts/lib/chart/effectScatter';
    // import 'echarts/lib/chart/lines';
    // import 'echarts/lib/chart/heatmap';
    
    // import 'echarts/lib/component/graphic';
    // import 'echarts/lib/component/grid';
    // import 'echarts/lib/component/legend';
    // import 'echarts/lib/component/tooltip';
    // import 'echarts/lib/component/polar';
    // import 'echarts/lib/component/geo';
    // import 'echarts/lib/component/parallel';
    // import 'echarts/lib/component/singleAxis';
    // import 'echarts/lib/component/brush';
    
    import 'echarts/lib/component/title';
    
    // import 'echarts/lib/component/dataZoom';
    // import 'echarts/lib/component/visualMap';
    
    // import 'echarts/lib/component/markPoint';
    // import 'echarts/lib/component/markLine';
    // import 'echarts/lib/component/markArea';
    
    // import 'echarts/lib/component/timeline';
    // import 'echarts/lib/component/toolbox';
    
    // import 'zrender/lib/vml/vml';
    

Using the component

<template>
  <div class="echarts">
    <IEcharts
      :option="bar"
      :loading="loading"
      @ready="onReady"
      @click="onClick"
    />
    <button @click="doRandom">Random</button>
  </div>
</template>

<script type="text/babel">
  import IEcharts from 'vue-echarts-v3/src/full.js';
  export default {
    name: 'view',
    components: {
      IEcharts
    },
    props: {
    },
    data: () => ({
      loading: true,
      bar: {
        title: {
          text: 'ECharts Hello World'
        },
        tooltip: {},
        xAxis: {
          data: ['Shirt', 'Sweater', 'Chiffon Shirt', 'Pants', 'High Heels', 'Socks']
        },
        yAxis: {},
        series: [{
          name: 'Sales',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        }]
      }
    }),
    methods: {
      doRandom() {
        const that = this;
        let data = [];
        for (let i = 0, min = 5, max = 99; i < 6; i++) {
          data.push(Math.floor(Math.random() * (max + 1 - min) + min));
        }
        that.loading = !that.loading;
        that.bar.series[0].data = data;
      },
      onReady(instance, ECharts) {
        console.log(instance, ECharts);
      },
      onClick(event, instance, ECharts) {
        console.log(arguments);
      }
    }
  };
</script>

<style scoped>
  .echarts {
    width: 400px;
    height: 400px;
  }
</style>

Properties

  • styles

    Optional; CSS style is { width: 100%; height: 100%; } by default.

  • initOpts & theme

    Optional; Used to initialize ECharts instance.

  • option [reactive]

    Used to update data for ECharts instance. Modifying this property will trigger ECharts' setOptions method.

  • group [reactive]

    Optional; This property is automatically bound to the same property of the ECharts instance.

  • notMerge

    Optional; false by default. Detail

  • lazyUpdate

    Optional; false by default. Detail

  • loading [reactive]

    Optional; false by default. Modifying this property will trigger ECharts' showLoading or hideLoading method.

  • loadingOpts

    Optional; Detail

  • resizable

    Optional; false by default.

See more ECharts' Option

Instance Methods

  • resize
  • update
  • mergeOption
  • dispatchAction
  • convertToPixel
  • convertFromPixel
  • containPixel
  • showLoading
  • hideLoading
  • getDataURL
  • getConnectedDataURL
  • clear

Static Methods

  • connect
  • disConnect
  • dispose
  • getInstanceByDom
  • registerMap
  • getMap
  • registerTheme

Learn more ECharts' API

Demo

vue-echarts-v3-demo

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].