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

@mt-kit/vue-echarts

v1.0.1

Published

Echarts

Readme

@mt-kit/vue-echarts

npm version GitHub stars GitHub issues License Documentation

Vue 3 中 ECharts 的封装,提供响应式的图表配置和便捷的使用方式。

相关资源:

安装

npm i echarts @mt-kit/vue-echarts

API

useECharts

ECharts 图表 Hook,提供响应式的图表配置和更新方法。

参数:

| 参数名 | 说明 | 类型 | 是否必传 | |--------|------|------|----------| | chartRef | 图表容器的 ref | Ref<HTMLDivElement> | 是 |

返回值:

| 属性名 | 说明 | 类型 | |--------|------|------| | setOptions | 设置图表配置 | (options: EChartsOption) => void |

使用示例:

<script lang="ts" setup>
import type { ComputedRef, Ref } from "vue";
import type { EChartsOption } from "@mt-kit/vue-echarts";
import { computed, ref } from "vue";
import { useECharts } from "@mt-kit/vue-echarts";

const chartRef = ref<HTMLDivElement | null>(null);

const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);

// 推荐使用 computed 创建响应式配置
// 注意:tooltip、grid、xAxis、yAxis 等配置应该根据项目提取为公共配置
const options: ComputedRef<EChartsOption> = computed(() => ({
  tooltip: {
    trigger: "axis",
    axisPointer: {
      lineStyle: {
        width: 1,
        color: "#019680"
      }
    }
  },
  grid: {
    left: "1%",
    right: "1%",
    top: "2%",
    bottom: 0,
    containLabel: true
  },
  xAxis: {
    type: "category",
    data: Array.from({ length: 12 }).map((_item, index) => `${index + 1}月`)
  },
  yAxis: {
    type: "value",
    max: 8000,
    splitNumber: 4
  },
  series: [
    {
      data: [3000, 2000, 3333, 5000, 3200, 4200, 3200, 2100, 3000, 5100, 6000, 3200],
      type: "bar",
      barMaxWidth: 80
    }
  ]
}));

setOptions(options.value);
</script>

<template>
  <div ref="chartRef" style="height: 500px; width: 100%"></div>
</template>

更多示例: 查看完整示例