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 🙏

© 2025 – Pkg Stats / Ryan Hefner

wf-charts-vue2

v0.0.1

Published

** 该组件库依赖 echarts ** ** 该组件库的默认导出是注册完成的组件库 **

Readme

npm 安装

** 该组件库依赖 echarts ** ** 该组件库的默认导出是注册完成的组件库 **

npm i wf-charts-vue2 -S
npm i [email protected] -S

快速上手

引入组件

在 main.js 中写入以下内容:

import Vue from 'vue';
import App from './App.vue';

import WfChartsVue2 from 'wf-charts-vue2'

Vue.use(WfChartsVue2)

new Vue({
  el: '#app',
  render: h => h(App)
});

开始使用

饼图

引入方式: 组件引入

<wf-pie-chart></wf-pie-chart>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 饼状图的宽度 | number 或 string | false | 500| | pieHeight | 饼状图的高度 | number 或 string | false | 500| | label | 标签文本的内容 | string | false | | | colorList | 饼状图的颜色值,默认给了 10 种颜色,当数据大于 10 时,会默认取最后一种颜色 | Arrary | false | | | pieData | 饼状图数据源,例:[{name:'一月',value:60}] | array | true | | | tooltipFormatter | tooltip 的显示格式,{a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比) | string | false | {b}: {c}人 | | labelFormatter | label 的显示格式,与 tooltipFormatter 类似 | string | false | {a|{b}:}{b|{d}%}| | seriesRadius | 饼状图的环形圆大小 | array | false | ["45%", "65%"]| | pieSeries | 需要重新配置饼状图的 series 时可使用,会覆盖键名相同的项 | object | false | | | pieGraphic | 需要重新配置饼状图的 graphic 时可使用,会覆盖键名相同的项 | object | false | | | center | 饼图的位置 | array | false | ["30%", "50%"] | | pieLegend | 图例的配置,详见下方 | object | false | | | left | 饼图中间文字距离左边的位置 | string | false | 36% | | top | 饼图中间文字距离上边的位置 | string | false | 50% |

** pieLegend Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | left | 距离左边的位置 | string | false | 80%| | itemGap | 上下的距离 | number | false | 20| | color | 文字的颜色 | string | false | "#000"| | top | 距离上方的位置 | string | false | center|

多个饼图

引入方式: 组件引入

<wf-many-piecharts></wf-many-piecharts>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 饼状图的宽度 | number 或 string | false | 500| | pieHeight | 饼状图的高度 | number 或 string | false | 500| | manyPieData | 饼状图数据源,例:[{name:'一月',value:60}] | array | true | | | userTotal | 统计的总数,用于计算百分比 | number | true | 0| | pieRadius | 饼状图的环形圆大小 | array | false | [50, 60]| | labelFontSize | label 的字体大小 | string | false | 20| | titleFontSize | title 的字体大小 | string | false | 12| | manyPieColorList | 饼状图的颜色值,二维数组,默认给了 5 对颜色值 | array | false | |

仪表盘

引入方式: 组件引入

<wf-dashboard></wf-dashboard>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 仪表盘的宽度 | number 或 string | false | 400| | pieHeight | 仪表盘的高度 | number 或 string | false | 400| | progressValue | 仪表盘的进度值 | number | true | 0 | | title | 标题 | string | false | 任务进度| | titleFontSize | 标题字号 | number | false | 20| | outerCircleRadius | 外层第一圈圆的大小 | string | false | 45%| | outerBicircleRadius | 外层第二圈圆的大小 | string | false | 50%| | annularCollocation | 环形进度条配置,详见下放配置 | Object | false | | | scaleCollocation | 外部刻度配置,详见下放配置 | Object | false | | | diskCollocation | 内部圆配置,详见下放配置 | Object | false | |

** annularCollocation Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | annularSize | 进度条圆大小 | string | false | 60%| | annularColor | 进度条颜色 | string | false | "#458EFD"| | annularWidth | 进度条宽度 | number | false | 14|

** scaleCollocation Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | scaleSize | 刻度大小 | string | false | 70%| | scaleMin | 最小刻度 | number | false | 0| | scaleMax | 最大刻度 | number | false | 100| | scaleNum | 刻度数量 | number | false | 10| | scaleFontColor | 字体颜色 | string | false | "#868FDF"| | scaleFontdistance | 文字位置 | number | false | 25| | axisTickNum | 刻度间距 | number | false | 7| | axisTickColor | 刻度颜色 | string | false | "#3082FE"| | axisTickWidth | 刻度宽度 | number | false | 2| | axisTickLength | 刻度长度 | number | false | -8| | splitLineColor | 刻度分割线颜色 | string | false | "#458EFD"| | splitLineLength | 刻度分割线长度 | number | false | -20|

** diskCollocation Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | diskRadius | 内部圆大小 | array | false | ["0", "40%"]| | diskcenter | 内部圆位置 | array | false | ["50%", "50%"]| | colorStart | 渐变色开始值 | string | false | "#3398ff"| | colorStart | 渐变色结束值 | string | false | "#7db0fd"| | diskFontSize | 字体大小 | number | false | 54|

柱状+折线

引入方式: 组件引入

<wf-column-brokenline></wf-column-brokenline>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 图表的宽度 | number 或 string | false | 500| | pieHeight | 图表的高度 | number 或 string | false | 500| | chartData | 图表的数据源,例:[{name:'一月',value:20}] | array | true | | | top | 距离上方的位置 | string | false | 15%| | right | 距离右方的位置 | string | false | 10%| | left | 距离左方的位置 | string | false | 10%| | bottom | 距离下方方的位置 | string | false | 12%| | xAxis | x 轴配置项,详见下方 | object | false | | | yAxis | y 轴配置项,详见下方 | object | false | | | xAxis | 圆柱配置项,详见下方 | object | false | |

** xAxis Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | xLabelMargin | label 边距 | number | false | 20| | xLabelColor | 字体颜色 | string | false | '#999'| | xLabelFontSize | 字体大小 | number | false | 18|

** yAxis Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | yLabelFormatter | label 的显示格式化 | string | false | "{value}%"| | yLabelColor | 字体颜色 | string | false | '#999'| | yLabelFontSize | 字体大小 | number | false | 18|

** series Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | sLabelFontSize | 字体大小 | number | false | 18| | sLabelColor | 字体颜色 | string | false | "#333"| | barBorderRadius | 圆柱的圆角 | array | false | [30, 30, 0, 0]| | lineColor | 折线的颜色 | string | false | "#3275FB"| | lineWidth | 折线的宽度| number | false | 4| | lineShadowColor | 折线的阴影颜色| string | false | "rgba(0, 0, 0, 0.3)"|

环形图

引入方式: 组件引入

<wf-annular></wf-annular>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 图表的宽度 | number 或 string | false | 500| | pieHeight | 图表的高度 | number 或 string | false | 500| | chartData | 图表的数据源,例:[{name:'本科及以上',value:13211,unit:'元'}] | array | true | | | colorList | 每个环形的颜色值 | array | false | ["#FF8700", "#ffc300", "#00e473", "#009DFF"]| | pieRadius | 每个环形的大小 | array | false | [["65%", "57%"],["50%", "42%"],["35%", "27%"],["20%", "12%"]]| | notesAllocation | 注释框的配置,详见下方 | object | false | |

** notesAllocation Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | lineWidth | 点线的宽度 | number| false | 170| | lineHeight | 点线的高度 | number | false | 10| | nameColor | 注释 name 的字体颜色 | string | false | "#666"| | nameFontSize | 注释 name 的字体大小 | number | false | 14| | bdColor | 分割线颜色 | string | false | '#ccc'| | bdPadding | 分割线的边距 | array | false | [0, 5]| | bdFontSize | 分割线的大小 | number | false | 14| | percentColor | 百分比值的字体颜色 | string | false | "#333"| | percentFontSize | 百分比值的字体大小 | number | false | 14| | valueColor | 注释 value 值的颜色 | string | false | "#333"| | valueFontSize | 注释 value 值的字体大小 | number | false | 16| | valuePadding | 注释 value 值的边距 | array | false | [0, 0, 0, 20]| | unitFontSize | 单位值的字体大小 | number | false | 14|

折线图

引入方式: 组件引入

<wf-line-chart></wf-line-chart>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 图表的宽度 | number 或 string | false | 600| | pieHeight | 图表的高度 | number 或 string | false | 600| | chartData | 图表数据源,数组对象,详见下方配置 | array | true | | | xAxisData | x 轴标题数组 | array | true | | | title | 标题 | string | false | '全国统计'| | titleFontSize | 标题字体大小 | number | false | 12| | titleLeft | 标题距离左边的位置 | string | false | 'center'| | legendAllocation | 顶部标题右侧指示点配置 | string | false | 'center'|

** chartData Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | name | 当前项统计名称 | string | true | | | data | 当前项统计值,数组值的长度请保持和 xAxisData 的长度一致 | array | true | | | lineColorStart | 折线线条的渐变色开始值 | string | false | 默认给了三组颜色值 | | lineColorEnd | 折线线条的渐变色结束值 | string | false | 默认给了三组颜色值| | dotColor | 鼠标悬浮折线指示圆点的颜色 | string | false | lineColorEnd 的值| | dotBorderColor | 鼠标悬浮折线指示圆点的 border 的颜色 | string | false | lineColorEnd 的值| | yAxisIndex | 当存在多条 y 轴时,给当前这个数据指定 y 轴,0 代表第一条 y 轴,1 代表第二条 y 轴 | number | true | 0|

** legendAllocation Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | itemWidth | 宽度 | number | false | 6| | itemGap | 边距 | number | false | 20| | color | 字体颜色 | string | false | '#556677'| | right | 距离右侧的位置 | string | false | '#556677'|

横向柱状

引入方式: 组件引入

<wf-transverse-col></wf-transverse-col>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 图表的宽度 | number 或 string | false | 600| | pieHeight | 图表的高度 | number 或 string | false | 600| | chartData | 图表数据源,例:[{name:'类别 1',value:4545}]| arrary | true | | | labelColor | label 的颜色值,前三取前三个颜色值,之后默认取最后一个颜色值 | arrat | false | ["#FD5360", "#FF962B", "#FFAA00", "#1890FF"]| | top | 图表距离上方的位置 | string | false | '5%'| | left | 图表距离左方的位置 | string | false | '1%'| | right | 图表距离右方的位置 | string | false | '15%'| | bottom | 图表距离下方的位置 | string | false | '3%'| | barWidth | 柱状的宽度 | number | false | 10| | barColorStart | 柱状渐变色的开始值 | string | false | "#3D9FFF"| | barColorEnd | 柱状渐变色的结束值 | string | false | "#41D7F3"|

折线图(库存)

引入方式: 组件引入

<wf-broken-line></wf-broken-line>

** Attributes ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | pieWidth | 图表的宽度 | number 或 string | false | 600| | pieHeight | 图表的高度 | number 或 string | false | 600| | chartData | 图表数据源,详见下方| array | true | | | xTitleData | x 轴 title,字符串数组| array | true | | | top | 图表距离上方的位置| string | false | 9% | | bottom | 图表距离下方的位置| string | false | 19% | | left | 图表距离左方的位置| string | false | 6% | | right | 图表距离右方的位置| string | false | 4% |

** chartData Options ** | 参数 | 说明 | 类型 | 是否必传 | 默认值 | | :----: | :----: | :----: | :----: | :----: | | name | 名称 | string | true | | | data | 数据统计值,个数需要和 xTitleData 相对应 | array | true | | | color | 折线颜色 | string | false | rgb(33,148,246) 和 rgb(162,218,101)| | shadowColor | 折线点颜色 | string | false | rgb(33,148,246,0.9)和 rgb(162,218,101,0.9)|