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

@bj-nsc/basechart

v1.1.6

Published

基础图表,包括柱图,线图,饼图

Downloads

42

Readme

@bj-nsc/basechart

工程进度表,可以查看工程开工竣工时间,总进度和子节点进度等信息

## 安装和使用

npm 安装

npm i "@bj-nsc/basechart

yarn 安装

yarn add "@bj-nsc/basechart

在代码里使用

import Chart from "@bj-nsc/basechart";

<Chart type={"bar"} cfgData={{ data: [{}], color: [] }} />;

## Props

属性详细说明:

  • type 图标类型(bar,line,pie)

  • cfgData 作图参数

  • option echart 图表所用 option(传 option 时,type、option、onChartClick 三个属性值有效,其他属性值无效)

  • onChartClick图表点击函数

  • bigSreen 是否为大屏样式,默认为 flase

  • convertData 是否需要对数据进行转换,默认为 true

    • cfgData 对象属性说明(柱线图):

      • data 数据
      • labelKey 坐标轴值对应的 key(需要进行数据转换的时候传)
      • legend 系列对象(需要进行数据转换的时候传)
      • isXY 是否 XY 轴互换,默认为 false
      • color 图形颜色数组
      • showDifferent 针对 1 个系列的柱图是否不同柱子显示不同颜色,默认 false
      • legendPosition 系列显示位置(top,bottom,topcenter,bottomcenter),默认为 top
      • lineColor 坐标轴颜色
      • textColor 字体颜色
      • tipTextColor 提示字体颜色
      • tipBackColor 提示框字体颜色
      • splintLineColor 分割线颜色

      data 格式说明

      • 数据需要转换的 data 格式

        data=[{label:周一,count:1,count1:3},{label:周二,count:3,count1:3},{label:周三,count:4,count1:2}],
        
        labelKey='label'
        legend=[{name:'数据系列1',type:'bar',key:'count'},{name:'数据系列1',type:'bar',key:'count2'}]

        legend 说明

        • name 系列名称
        • type 系列类型(line,bar)
        • key 对应 data 数据对象的 key
        • stack 是否堆叠 (默认 false)
        • stackIndex 堆叠值(stack 为 true 有效)
        • width 柱子宽度或者线的宽度
      • 不需要数据转换的 data 格式

        ```
        data={xData:['周一','周二','周三'],yData:[{name:'系列1',data:[1,2,4],type:'bar'},{name:'系列2',data:[3,2,2],type:'bar'}]}
        ```
    • cfgData 对象属性说明(饼图):

      • data 数据
      • legend 系列对象(需要进行数据转换的时候传)
      • color 图形颜色数组
      • legendPosition 系列显示位置(top,bottom,right,left,不传不显示,默认不显示)
      • lineColor 坐标轴颜色
      • textColor 字体颜色
      • tipTextColor 提示字体颜色
      • tipBackColor 提示框字体颜色
      • showtooltip 是否显示提示
      • isLoop 是否为圆环(默认为 false)
      • label 图形中心显示的标签
      • labelSize 标签字体大小
      • labelColor 标签字体颜色
      • radius 圆环大小(设置后 isLoop 失效)

      data 格式说明

      • 需要做数据格式转换
       data= { level1: 34, level2: 64, level3: 100 }
       legend=[
                { name: "等级1", key: "level1" },
                { name: "等级2", key: "level2" },
                { name: "等级3", key: "level3" },
              ]
      • 不需要做数据格式转换
      data=[ { name: "等级1", value:1 },
              { name: "等级2", value: 2},
              { name: "等级3", value: 3 }]
  • option 数据格式参考 echarts 官方配置