🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ez-vue-chart

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ez-vue-chart

vue图表组件,结合ez-chart方便快捷的生成图表

latest
Source
npmnpm
Version
0.0.9
Version published
Weekly downloads
4
-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

ez-vue-chart

结合ez-chart使用的vue组件,自动watch数据 打印log,监听resize事件等

安装

npm install ez-vue-chart yarn add ez-vue-chart

使用

// main.js
import Vue from 'vue'
import App from './App.vue'
import lodash from 'lodash';
import echarts from 'echarts'
import EzChart from 'ez-chart'
import ezVueChart from 'ez-vue-chart'
Vue.use(ezVueChart)
new Vue({
  el: '#app',
  render: h => h(App)
})
// app.vue
<template>
  <div id="app">
      <ez-chart :data="data" :keyMap="['label', 'val', 'val2']" type="bar" register="click"></ez-chart>
  </div>
</template>
<script>
export default {
  name: 'app',
  data () {
    return {
      data: [
        {
          label: 'test',
          val: 111,
          val2: 31,
        },
        {
          label: 'test2',
          val: 312,
          val2: 142,
        }
      ]
    }
  }
}
</script>

示例地址

展示地址

参数

EzVueChart Attributes

参数说明类型可选值默认值
type选择渲染的图表类型stringbar/line/pie/funnel/scatter 以及customType--
keyMap传入的data中需要提取的值的key集合Arrary:string--['label', 'value']
data原始数据array<object>----
paramsezChart.getOption的params参数object--{}
echartsInitOptionsecharts.init初始化时的参数object--{}
registerTheme使用的图标主题string--''
register注册的事件string|array----
resizeWaitingresize事件触发防抖函数的等待时间number--500
styles默认的图表样式只会拿到宽度和高度作为echarts.init的初始项,会被echartsInitOptions覆盖Object--{ height: '300px',width: 'auto'}
log是否打印日志Boolean--false

EzVueChart Methods

方法名说明参数
renderChart渲染图表--

EzVueChart Events

事件名称说明参数
listener触发绑定的监听事件event 事件名称, params echarts返回的原始参数, data 原始数据

EzVueChart Slot

名称说明
--自定义缺省页样式

外部依赖

externals = {
    echarts: 'echarts',
    'ez-chart': 'EzChart',
    vue: 'Vue',
    lodash: 'lodash',
}

Keywords

echarts

FAQs

Package last updated on 03 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts