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

superchart-js

v1.0.3

Published

Supercharge your charts with ChartJS Enhanced!

Readme

superchart-js

Supercharge your charts with ChartJS Enhanced!

🌟 npm package

Checkout the npm package of SuperChartJS:
👉 Open

Demo of the Project

This package is an enhanced version of the Chart.js library. The original Chart.js is distributed under the MIT License, and this package builds on the original Chart.js by adding additional functionality through plugins and extra scripts. No changes have been made to the original Chart.js source code.

Acknowledgments

Original library: Chart.js

superchart-js is a robust extension of the popular ChartJS library, designed to offer advanced charting capabilities with greater flexibility and customization options. This library builds upon the foundation of ChartJS, adding new features such as dynamic data sorting, enhanced styling, and additional chart types, enabling developers to create more interactive and visually appealing data visualizations.

📦 Installation

Choose your preferred installation method:

# Using npm
npm install superchart-js

# Using yarn
yarn add superchart-js

# Using pnpm
pnpm add superchart-js

🚀 Quick Start

📥 Import Options

  1. CDN (JSDelivr)
import { Plotter } from 'https://cdn.jsdelivr.net/npm/superchart-js/dist/superchart-js.es.js';
  1. ES Module
import { Plotter } from 'superchart-js';
  1. CommonJS
const { Plotter } = require('superchart-js');
  1. Specific Path
import { Plotter } from './node_modules/superchart-js/dist/superchart-js.es.js';

🏗️ Basic Setup

  1. Add HTML Structure
<!-- Single Chart -->
  <div id="chart-wrapper" class="chart-wrapper"> </div>
  1. Initialize SuperChartJS
import { Plotter } from 'superchart-js';

💡 Usage Examples

const chartData = {
  chartTitle: "Monthly Sales Revenue",
  xAxisValues: [
    "2024-01-01",
    "2024-02-01",
    "2024-03-01",
    "2024-04-01",
    "2024-05-01",
    "2024-06-01",
    "2024-07-01",
    "2024-08-01",
    "2024-09-01",
    "2024-10-01",
    "2024-11-01",
    "2024-12-01"
  ],
  axisLabels: {
    xAxisLabel: "Month",
    yAxisLabel: "Revenue (USD)"
  },
  legends: [
    {
      label: "Product A Sales",
      data: [500, 700, 800, 1200, 1500, 1400, 600, 550, 900, 1000, 1100],
      type: "area",
    },
  ],
  toggleChartTypeSwitch: true,
  legendSorting: true,
  drawToolBox: false,
  enableChartDownload: true,
  showAnalytics: true,
  analyticsModel: {
    theme: 'black'
  },
};

const graph = new Plotter();
graph.plotChart(chartData);

📊 Chart Configuration

🏷️ chartTitle (mandatory)

The title of the chart.

📅 xAxisValues (mandatory)

An array of values to be displayed on the x-axis.

🏷️ axisLabels (optional)

Names for the axis labels.

  • 🏷️ xAxisLabel: Name for the x-axis.
  • 🏷️ yAxisLabel: Name for the y-axis.

📜 legends (mandatory)

An array of legends. Each legend should have the following properties:

  • 🏷️ label (mandatory): The legend name.

  • 📊 data (mandatory): An array of values.

  • 🔄 type (optional): Possible types are 'Line', 'Area', 'Bar', 'Radar', 'Pie', and 'Doughnut'. Default is 'Line'.

  • 🎨 borderColor (optional): Custom border color.

  • 🎨 fillColor (optional): Custom fill color.

  • 🎨 aboveColor (optional): Custom above color.

🔌 Plugins

🔄 legendSorting

Used to turn on/off the sorting plugin.

  • Default value is true. If the chart contains only one legend, the sorting option will be visible on the chart.
  • Set it to false to turn it off.

🔄 toggleChartTypeSwitch

Used to enable the legend type-changing feature.

  • Default value is false. Set it to true to enable it.

🔄 xAxisBeginAtZero

Type: bool Sets the beginning value of the x-axis to zero. This property only works if the x-axis contains numerical values. Default Value: true

🔄 yAxisBeginAtZero

Type: bool Sets the beginning value of the y-axis to zero. Default Value: true

🔄 enableChartDownload

Type: bool By enabling this plugin, you can download the chart as a PDF Default Value: false

🔄 showAnalytics

Type: bool By enabling this plugin, you can see the analytics of the chart Default Value: false

🔄 analyticsModel

Type: object By configuring this plugin, you can customize the analytics of the chart Default Value: analyticsModel: { theme: 'light' } So far we can customize the theme of the analytics, we will add more features in the future.

Example

<body>
  <div id="chart-wrapper" class="chart-wrapper">

  </div>
  <div id="chart-wrapper" class="chart-wrapper">

  </div>
  <div id="chart-wrapper" class="chart-wrapper">

  </div>
</body>

<script type="module">
  // import { Plotter } from '../package/src/js/Plotter.js';
  import { Plotter } from '../dist/superchart-js.es.js';
  // import { Plotter } from '../node_modules/superchart-js/dist/superchart-js.es.js';
  // import { Plotter } from 'superchart-js';

  document.addEventListener('DOMContentLoaded', async () => {
    const chartData = {
      chartTitle: "Monthly Sales Revenue",
      xAxisValues: [
        "2024-01-01",
        "2024-02-01",
        "2024-03-01",
        "2024-04-01",
        "2024-05-01",
        "2024-06-01",
        "2024-07-01",
        "2024-08-01",
        "2024-09-01",
        "2024-10-01",
        "2024-11-01",
        "2024-12-01"
      ],
      axisLabels: {
        xAxisLabel: "Month",
        yAxisLabel: "Revenue (USD)"
      },
      legends: [
        {
          label: "Product A Sales",
          data: [500, 700, 800, 1200, 1500, 1400, 600, 550, 900, 1000, 1100],
          type: "area",
        },
      ],
      toggleChartTypeSwitch: true,
      legendSorting: true,
      drawToolBox: false,
      enableChartDownload: true,
      showAnalytics: true,
      analyticsModel: {
        theme: 'black'
      },
    };

    const graph = new Plotter();
    graph.plotChart(chartData);
  });
</script>

🌟 Demo

Check out the live demo of SuperChartJS:
👉 Open

Or you can clone the repository and run the docs/index.html file to see the demo.

git clone https://github.com/sanju9645/superchart-js.git
cd superchart-js
npm i
open docs/index.html

Make the changes on the index.html

npm run dev

🤝 Contributing

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

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Support

If you have any questions or need help, please open an issue.