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

my-chart-demo

v1.2.3

Published

``` yarn add my-chart-demo // npm install my-chart-demo --save ```

Downloads

10

Readme

my-chart-demo

tips: 个人兴趣做的插件,当前是非常基础的,仅仅个人测试demo。勿喷~

1. 安装

yarn add my-chart-demo // npm install my-chart-demo --save

2. 字段

  • 颜色主题类型

    enum EThemeType {
      walden = 0,
      vintage = 5,
      westeros = 10,
      shine = 15,
      macarons = 20,
    }
  • 图表类型枚举

    enum EChartType {
      MSLine = 0,  // 折线
      MSBar = 5,   // 柱状
    }
  • 图表数据类型枚举

    enum EChartDataType {
      static = 0,  // 静态
      dynamic = 5,  // 动态
    }
  • IChartData接口

      // 数据项id
      id: string;
     // 数据项名
      name: string;
      // 数据
      value: string;

| 字段名 | 字段类型 | 默认值 | 备注 | | :--------------: | :-----------------: | :---------------: | :----------------------: | | id | string | Guid.EMPTY | 表id | | name | string | | 图表名 | | themeType | EThemeType | EThemeType.walden | 颜色主题类型 | | chartType | EChartType | EChartType.MSLine | 图表类型 | | dataType | EChartDataType | | 数据类型,分为静态和动态 | | categoryData | string | | 类目轴数据 | | chartsData | Array<IChartData> | | 数据项数据 |

3. 传递参数

| 字段名 | 字段类型 | 备注 | | :--------------: | :--------------------------: | :--------------------: | | width | number\| string\|undefined | 图表的宽度 | | height | number\|string\|undefined | 图表的高度 | | charts | IChart | 图表的数据 | | idName | string | 图表的类名 | | devicePixelRatio | number\|undefined | 设备像素比 | | renderer | string\|undefined | 渲染方式 canvas| svg |

4. 例子

    1. main文件引入

      import MSChart from "my-chart-demo";
      Vue.use(MSChart);
    1. 测试组件 测试数据在项目中

生成图表: