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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tanzhenxing/zx-charts-area

v1.0.2

Published

zx-charts-area 图表组件

Readme

zx-charts-area 面积图组件

组件简介

zx-charts-area 是基于 Vue3 + + uni-app 实现的高性能多端面积图表组件,支持 H5、微信/支付宝/百度/字节小程序、App 等平台。无需依赖浏览器专属 API,适合数据可视化场景。

属性(Props)

| 属性名 | 类型 | 默认值 | 说明 | |------------------|-----------------|---------------|------| | width | Number/String | 620 | 图表宽度(rpx) | | legend | Object | {show: false, size: 24, color: '#333'} | 图例配置 | | tooltip | Boolean | false | 是否显示 tooltip 提示 | | xAxis | Array | [] | x 轴刻度数组 | | currentIndex | Number | -1 | 默认选中 x 轴索引 | | splitLine | Object | {color: '#e3e3e3', type: 'dashed'} | 分割线样式 | | xAxisTick | Object | {height: '12rpx', color: '#e3e3e3'} | x 轴刻度线样式 | | xAxisLine | Object | {color: '#e3e3e3', itemGap: 120} | x 轴线条样式及间距 | | xAxisLabel | Object | {color: '#333', size: 24, height: 60} | x 轴标签样式 | | xAxisVal | Object | {show: true, color: '#333', size: 24, height: 48} | x 轴 value 样式及显示 | | yAxisSplitLine | Object | {color: 'transparent', type: 'dashed'} | y 轴分割线样式 | | brokenDot | Object | {width: 12, color: '#F8F8F8'} | 折线点样式 | | brokenLineHeight | Number/String | 1 | 折线高度/粗细(px) | | yAxis | Array | [] | y 轴自定义刻度(不传则自动计算) | | min | Number | 0 | y 轴最小值 | | max | Number | 100 | y 轴最大值 | | splitNumber | Number | 20 | y 轴分段递增数值 | | yAxisLine | Object | {color: '#e3e3e3', itemGap: 60} | y 轴线条样式及间距 | | yAxisLabel | Object | {show: true, color: '#333', size: 24} | y 轴标签样式 | | scrollable | Boolean | false | x 轴是否可滚动 |

dataset 数据格式

通过 draw(dataset) 方法传入,格式如下:

[
  {
    name: '系列1',
    color: '#3b82f6',
    source: [10, 20, 30, 40, 50]
  },
  {
    name: '系列2',
    color: '#f59e42',
    source: [20, 15, 35, 25, 45]
  }
]

事件

| 事件名 | 说明 | 回调参数 | |--------|------|----------| | click | 点击数据点时触发 | { datasetIndex, sourceIndex, ...datasetItem } |

方法

| 方法名 | 说明 | 参数 | |--------|------|------| | draw | 绘制/更新图表 | (dataset, xAxisValFormatter) |

基本用法示例

详见下方示例或 src/pages/components/charts/area.vue

注意事项

  • 组件为多端兼容实现,不依赖 window/document。
  • 建议在页面 onReady 或 onMounted 后调用 draw 方法。
  • xAxis、dataset.source 数组长度需一致。
  • 支持自定义颜色、格式化 value、图例等。