npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-echarts3

v1.0.3

Published

Vue component with ECharts.js(v3.x+)

Downloads

8

Readme

vue-echarts3

npm npm

基于Vue2,echart3封装的图表组件

Features

  • 暂支持柱状图、折线图、饼图
  • 简单易用

Installation

npm install vue-echarts3 --save

Usages

import Echarts from 'vue-echarts3';

Vue.component('echarts', Echarts);
<echarts
	:title="{'text':'标题'}"
	:options="data"
	:legendShow="['页面PV','页面UV']"
	type="bar"
	className="f-echarts">
</echarts>

柱状图options参数(demo)

	data: {
        legend: {
          data: [ '页面PV', '页面UV', '下载PV', '下载UV', '激活量', '注册量' ]
        },
        xAxis: [
          {
            type: 'category',
            data: [ '20170201', '20170202', '20170203', '20170204', '20170205', '20170206', '20170207' ]
          }
        ],
        series: [
          {
            name: '页面PV',
            type: 'bar',
            label: 'emphasis',
            data: [ 320, 332, 301, 334, 390, 330, 2 ]
          }
        ]
      }

折线图options参数(demo)

	data: {
        legend: {
          data: [ '页面PV', '页面UV', '下载PV', '下载UV', '激活量', '注册量' ]
        },
        xAxis: [
          {
            type: 'category',
            data: [ '20170201', '20170202', '20170203', '20170204', '20170205', '20170206', '20170207' ]
          }
        ],
        series: [
          {
            name: '页面PV',
            type: 'line',
            stack: '总量',
            areaStyle: { normal: {} },
            data: [ 320, 332, 301, 334, 390, 330, 2 ]
          }
        ]
      }

饼图options参数(demo)

	data: {
        legend: {
          orient: 'vertical',
          x: 'left',
          data: [ '页面PV', '页面UV', '下载PV', '下载UV', '激活量', '注册量' ]
        },
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b}: {c} ({d}%)'
        },
        series: [
          {
            name: '访问来源',
            type: 'pie',
            radius: [ '50%', '70%' ],
            avoidLabelOverlap: false,
            label: {
              normal: {
                show: false,
                position: 'center'
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSize: '30',
                  fontWeight: 'bold'
                }
              }
            },
            labelLine: {
              normal: {
                show: false
              }
            },
            data: [
              { value: 335, name: '页面PV' },
              { value: 310, name: '页面UV' },
              { value: 234, name: '下载PV' },
              { value: 135, name: '下载UV' },
              { value: 1548, name: '激活量' },
              { value: 548, name: '注册量' }
            ]
          }
        ]
      }

API

config

参数名 | 类型 | 默认值 | 备注 ------------ | ------------- | ------------ | --------- title | Object | - | 图表的标题 className | String | - | 图表容器的样式 legendShow | Array | - | 图表tab数据按照传入值显示,不传该参数默认全部显示 type | String | - | 必填,图表类型,目前柱状图bar,折线图line,饼图pie options | Object | - | 必填,控制图表显示的数据(上方已提供demo) theme | String | - | 图表主题 initOptions | Object | - | 图表初始化参数

function
  • clear() 重置图表组件数据
  • refresh() 数据变化后,可手动刷新图表组件

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repository and submit pull requests.

Release Notes

see CHANGELOG

LICENSE

npm