vue-plugin-echarts

1.0.2 • Public • Published

安装

npm install vue-plugin-echarts

引入

// index.js

import Vue from 'vue'
import vueEcharts from 'vue-plugin-echarts' 

Vue.use(vueEcharts);

使用

// Echarts.vue

<template>
  <div>
    <echarts v-bind:options="chartsOptions" v-bind:area="area"></echarts>
  </div>
</template>

<script>
export default {
  data() {
    return {
      area: "",
      chartsOptions: {
        tooltip: {},
        legend: { data: ["价格"] },
        xAxis: { data: ["北京", "上海", "深圳"] },
        yAxis: {},
        series: {
          name: "价格",
          type: "bar",
          data: [
            { _area: "北京", value: 0.19673821546264803 },
            { _area: "上海", value: 12.841810854861977 },
            { _area: "深圳", value: 12.064078596403768 }
          ]
        }
      }
    };
  }
};
</script>

Readme

Keywords

Package Sidebar

Install

npm i vue-plugin-echarts

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

5.36 kB

Total Files

3

Last publish

Collaborators

  • stefanieliang