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

wepy-com-charts

v1.0.6

Published

微信小程序图表控件,适用于wepyjs框架

Readme

微信小程序 wepyjs 图表控件 wepy-com-charts

说明

基于微信小程序canvas开发的图表控件,适用于wepy框架

暂时只有折线图,后续提供更多的图表

使用

安装组件

npm install wepy-com-charts --save

引用组件

<template>
    <lineChart></lineChart>
</template>
<script>
    import wepy from 'wepy';
    import Charts from 'wepy-com-charts';

    export default class Index extends wepy.page {
        components = {
            lineChart: Charts
        };
    }
</script>

调用方法

//调用draw方法可以产出图像
this.$invoke('lineChart', 'draw');

Props传值说明

| 属性 | 默认值 | 类型 | 必填 | 说明 | |-----------------|----------------|---------------------|------|----------------------------------------------------------------------------------| | collection | [] | array | 是 | 图表数据,格式如下:[ {name:'line name',data:[{key:'对应label的值',value:10}]} ] | | labels | [] | array | 是 | x轴分布的label | | colors | ['#FF5974'...] | array | 否 | 数据线颜色 | | paddingX | 18 | number | 否 | x轴内边距 | | paddingY | 15 | number | 否 | y轴内边距 | | height | 215 | number | 否 | 图表的高度 | | width | device width | number | 否 | 图表的宽度,默认取设备的宽度 | | lineWidth | 2 | number | 否 | 数据线的大小 | | axesColor | #F5F5F5 | color | 否 | 坐标颜色 | | xLabelColor | #111111 | color | 否 | x轴label的颜色 | | yLabelColor | #111111 | color | 否 | y轴label的颜色 | | onXLabelFilter | null | function/'enable' | 否 | x轴label过滤回调函数,设置为enable时全部x轴label显示 | | onYLabelFilter | null | function/'enable' | 否 | y轴label过滤回调函数,设置为enable时全部y轴label显示 | | yLabelFormat | null | function | 否 | y轴label显示格式回调函数 | | yLabelRows | 5 | number | 否 | y轴label显示个数 | | onXAxesFilter | null | function/'enable' | 否 | x轴背景坐标过滤回调函数,设置为enable全部显示 | | onYAxesFilter | null | function/'enable' | 否 | y轴背景坐标过滤回调函数,设置为enable全部显示 | | showFollowXAxes | false | boolean | 否 | x轴跟随坐标是否显示 | | showFollowYAxes | false | boolean | 否 | y轴跟随坐标是否显示 | | onActived | null | function | 否 | 手指选中某一列时触发的回调函数,可以获取该列所有点的数据 | | positionX | 0 | number | 否 | 画板x轴位置,用于手指拖到计算 | | positionY | 0 | number | 否 | 画板y轴位置,用于手指拖到计算 | | showDetailPanel | true | boolean | 否 | 是否显示详细面板 |