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

@ahwecharts/bar-stacked

v1.0.0

Published

echarts bar stacked component

Downloads

6

Readme

react echarts bar stacked

多柱状图echarts图表。提取常用api进行封装的echarts插件。

安装

npm install --save @ahwecharts/bar-stacked

引入

import BarStackedEcharts from '@ahwecharts/bar-stacked';
or
import { BarStackedEcharts } from 'ahwecharts';

基本用法

import ReactDOM from 'react-dom';
import BarStackedEcharts from '@ahwecharts/bar-stacked';

ReactDOM.render(
  <div>
    <BarStackedEcharts
      itemStyle={{
        barWidth: 20
      }}
      data={[
        { 
          name: '周一', 
          child: [
            { name: '邮件营销1', value: 120},
            { name: '邮件营销2', value: 132},
            { name: '邮件营销3', value: 101},
            { name: '邮件营销4', value: 134},
            { name: '邮件营销5', value: 90},
          ]
        },
        { 
          name: '周二', 
          child: [
            { name: '邮件营销1', value: 220},
            { name: '邮件营销2', value: 182},
            { name: '邮件营销3', value: 191},
            { name: '邮件营销4', value: 234},
            { name: '邮件营销5', value: 290},
          ]
        },
        { 
          name: '周三', 
          child: [
            { name: '邮件营销1', value: 150},
            { name: '邮件营销2', value: 232},
            { name: '邮件营销3', value: 201},
            { name: '邮件营销4', value: 154},
            { name: '邮件营销5', value: 190},
          ]
        }
      ]}
    />
  </div>,
  _mount_
);

Props Bar Stacked

| 参数 | 说明 | 类型 | 默认值 | | -------- | -------- | -------- | -------- | | width | 宽 | string | 100% | | height | 高 | string | 100% | | isHorizontal | 是否横排 | boolean | false | | colors | 柱状图颜色 | string[] | -- | | color | 文字颜色 | string | #333 | | lineColor | x, y轴轴线线条颜色 | string | #abb9d0 | | splitColor | x, y轴网格线条颜色 | string | #e0e7f3 | | fontSize | 字体大小 | number / string | 14 | | grid | 组件容器 | GridComponentOption | {} | | legend | 图例组件 | LegendComponentOption | {} | | xAxis | X 轴配置 | xAxisProps | -- | | yAxis | Y 轴配置 | yAxisProps | -- | | areaStyle | 柱状图填充样式 | areaStyleProps | -- | | itemStyle | 柱状图填充样式 | itemStyleProps | -- | | isSwitch | 是否自动切换 Tooltip | boolean | false | | switchTime | 自动切换时间 | number | 2000 | | data | 数据 | any[] | [] | | onClick | 点击 | (v: any) => void | -- |

Props data[]

| 参数 | 说明 | 类型 | 默认值 | | -------- | -------- | -------- | -------- | | name | 健 | string | -- | | child | 值 | any[{name: string, value: number}] | -- |

Props xAxisProps

| 参数 | 说明 | 类型 | 默认值 | | -------- | -------- | -------- | -------- | | color | 文字颜色 | string | #333 | | fontSize | 字体大小 | number / string | 14 | | lineColor | x轴轴线线条颜色, false 则不显示 | string / boolean | false | | splitColor | x轴网格线条颜色, false 则不显示, 默认true | string / boolean | true | | rotate | 刻度标签旋转角度 | number | 0 | | isTick | 是否显示坐标轴刻度 | boolean | false |

Props yAxisProps

| 参数 | 说明 | 类型 | 默认值 | | -------- | -------- | -------- | -------- | | name | 坐标轴名称 | string | -- | | color | 文字颜色 | string | #333 | | fontSize | 字体大小 | number / string | 14 | | lineColor | y轴轴线线条颜色, false 则不显示 | string / boolean | false | | splitColor | y轴网格线条颜色, false 则不显示, 默认true | string / boolean | true |

Props itemStyleProps

| 参数 | 说明 | 类型 | 默认值 | | -------- | -------- | -------- | -------- | | isStack | 是否叠加显示 | boolean | false | | barWidth | 柱条的宽度 | number | -- | | borderRadius | 柱条圆角半径 | number[] | -- |

Props GridComponentOption

API

Props LegendComponentOption

API