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

@meanpug/charting

v1.0.0

Published

A comprehensive charting library built on Apache ECharts with theming and API integration

Readme

@meanpug/charting

A comprehensive charting library built on Apache ECharts with theming and API integration.

Installation

npm install @meanpug/charting echarts

Note: echarts is a peer dependency and must be installed separately.

Features

  • 🎨 8 Pre-configured Chart Types - Bar, Line, Pie, Scatter, Area, Radar, Heatmap, and Gauge
  • 🎭 Built-in Theming System - Light, Dark, and Custom themes included
  • 🔌 API Integration - Utilities for fetching and rendering data from APIs
  • 📊 TypeScript Support - Full type definitions included
  • Tree-shakeable - ES modules for optimal bundle size
  • 🎯 Type-safe - Comprehensive TypeScript types for all functions

Quick Start

import { createBarChart } from '@meanpug/charting';

// Create a simple bar chart
const chart = createBarChart('chart-container', {
  title: { text: 'Monthly Sales' },
  xAxis: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
  series: [
    { name: 'Sales', data: [120, 200, 150, 80, 70] }
  ]
});

Available Chart Types

Bar Charts

import { createBarChart, createHorizontalBarChart, createStackedBarChart } from '@meanpug/charting';

createBarChart(container, config);
createHorizontalBarChart(container, config);
createStackedBarChart(container, config);

Line Charts

import { createLineChart, createSmoothLineChart, createMultiAxisLineChart } from '@meanpug/charting';

createLineChart(container, config);
createSmoothLineChart(container, config);
createMultiAxisLineChart(container, config);

Pie Charts

import { createPieChart, createDonutChart, createRoseChart } from '@meanpug/charting';

createPieChart(container, config);
createDonutChart(container, config);
createRoseChart(container, config);

Other Chart Types

  • Scatter/Bubble: createScatterChart, createBubbleChart
  • Area: createAreaChart, createStackedAreaChart
  • Radar: createRadarChart
  • Heatmap: createHeatmapChart
  • Gauge: createGaugeChart

Theming

The library includes three built-in themes:

Using Built-in Themes

import { createBarChart } from '@meanpug/charting';

// Use custom theme (default)
const chart = createBarChart(container, config, 'custom');

// Use light theme
const chart = createBarChart(container, config, 'light');

// Use dark theme
const chart = createBarChart(container, config, 'dark');

Apply Theme to Existing Chart

import { applyTheme } from '@meanpug/charting';

applyTheme(chart, 'dark');

Custom Theme

import { createBarChart, getTheme } from '@meanpug/charting';

const customTheme = {
  color: ['#3e51cd', '#ea3933', '#FFC300'],
  backgroundColor: '#ffffff',
  textStyle: { color: '#333' }
  // ... more theme properties
};

const chart = createBarChart(container, config);
applyTheme(chart, customTheme);

API Data Integration

Fetch data from an API and render charts:

import { fetchDataAndRender, updateChartFromApi, createLineChart } from '@meanpug/charting';

// Fetch and render in one step
await fetchDataAndRender(
  'chart-container',
  'https://api.example.com/data',
  createLineChart
);

// Update existing chart from API
await updateChartFromApi(
  chart,
  'https://api.example.com/data',
  (data) => ({
    xAxis: data.labels,
    series: data.series
  })
);

Configuration

All chart functions accept a ChartConfig object:

interface ChartConfig {
  title?: { text: string; [key: string]: any };
  xAxis?: any[];
  yAxis?: any;
  series: SeriesData[];
  legend?: boolean | any;
  tooltip?: boolean | any;
  grid?: any;
  rotateLabels?: number;
}

Examples

Multi-Series Line Chart

import { createLineChart } from '@meanpug/charting';

const chart = createLineChart('container', {
  title: { text: 'Temperature Trends' },
  xAxis: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  series: [
    { name: 'Max Temp', data: [25, 27, 26, 28, 30, 29, 28] },
    { name: 'Min Temp', data: [15, 16, 15, 17, 18, 17, 16] }
  ]
}, 'custom');

Donut Chart with Custom Colors

import { createDonutChart } from '@meanpug/charting';

const chart = createDonutChart('container', {
  title: { text: 'Market Share' },
  series: [
    { name: 'Products', data: [
      { name: 'Product A', value: 335 },
      { name: 'Product B', value: 234 },
      { name: 'Product C', value: 154 }
    ]}
  ]
}, 'custom');

Radar Chart

import { createRadarChart } from '@meanpug/charting';

const chart = createRadarChart('container', {
  title: { text: 'Performance Metrics' },
  series: [
    {
      name: 'Metrics',
      data: [85, 90, 75, 88, 92],
      indicators: [
        { name: 'Speed', max: 100 },
        { name: 'Accuracy', max: 100 },
        { name: 'Efficiency', max: 100 },
        { name: 'Quality', max: 100 },
        { name: 'Reliability', max: 100 }
      ]
    }
  ]
});

TypeScript

Full TypeScript support with type definitions:

import { 
  ChartConfig, 
  SeriesData, 
  Theme, 
  EChartsInstance 
} from '@meanpug/charting';

Browser Support

Supports all modern browsers that Apache ECharts supports:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • Opera

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Links