1.0.3 • Published 11 months ago

ve-echart v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

参数

参数      含义        类型  是否必须默认
option图表的配置Objecttrue
w图表的宽度Numberfalse400
h图表的高度Numberfalse320
theme主题String, Objectfalse
renderer渲染器Stringfalse

使用实例:

<Chart :option="data" :w="400" :h="400"></Chart>

获取 Echarts 对象的方法

1.使用 refs 取得 Echarts 实例

const chart = this.$refs['mychart'].chart
// 数据更新
const opt = {}
this.$refs['mychart'].updateChart(opt)

支持的方法,理论支持 echarts 所有方法,具体方法列表请查阅 API 文档

组件使用

<template>
  <div class="box">
    <Chart class="charts" :option="mock"></div>
  </div>
</template>

<script>
  import Chart from 've-echarts'
  export default {
    components: {
      Chart
    },
    data () {
      return {
        mock: {
            xAxis: {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: [120, 200, 150, 80, 70, 110, 130],
                    type: 'bar'
                }
            ]
        }
      }
    }
  }
</script>
1.0.3

11 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago