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

chartjs-plugin-chart2music

v0.7.0

Published

Chart.js plugin for Chart2Music. Turns chart.js charts into music so the blind can hear data.

Readme

chartjs-plugin-chart2music

npm version

chartjs-plugin-chart2music connects Chart.js charts to Chart2Music, providing keyboard navigation, screen-reader output, and interactive data sonification. Focus a chart to explore its data with the keyboard; the active data point is also highlighted on the visual chart.

This plugin is in beta. The supported chart types and integration points are listed below.

Install and use

npm install chart.js chartjs-plugin-chart2music

Register the plugin globally:

import Chart from "chart.js/auto";
import chart2music from "chartjs-plugin-chart2music";

Chart.register(chart2music);

new Chart(canvasElement, {
    type: "bar",
    data: {
        labels: ["Q1", "Q2", "Q3", "Q4"],
        datasets: [{label: "Revenue", data: [1, 4, 2, 8]}]
    }
});

Or add it to one chart only:

new Chart(canvasElement, {
    type: "bar",
    data: {
        datasets: [{data: [1, 4, 2, 8]}]
    },
    plugins: [chart2music]
});

When no cc element is supplied, the plugin creates a caption element immediately after the canvas. Supply your own element when you need to control where the Chart2Music output appears.

Plugin options

Configure the plugin through options.plugins.chartjs2music:

new Chart(canvasElement, {
    type: "bar",
    data: {
        labels: ["Q1", "Q2", "Q3", "Q4"],
        datasets: [{label: "Revenue", data: [1, 4, 2, 8]}]
    },
    options: {
        plugins: {
            chartjs2music: {
                cc: outputElement,
                lang: "en",
                axes: {
                    x: {label: "Quarter"},
                    y: {
                        label: "Revenue",
                        format: (value) => `$${value.toLocaleString()}`
                    }
                },
                options: {
                    enableSound: true,
                    onFocusCallback: (point) => console.log(point),
                    onSelectCallback: ({point}) => console.log(point)
                },
                errorCallback: console.error
            }
        }
    }
});

Available plugin options:

  • cc: Element that receives Chart2Music's accessible chart caption. Optional.
  • lang: Chart2Music language. Supported values include en, de, es, fr, and it; default is en.
  • axes: Chart2Music axis configuration, including labels and value formatters.
  • audioEngine: A custom Chart2Music audio engine.
  • options: Chart2Music interaction options such as enableSound, onFocusCallback, and onSelectCallback.
  • errorCallback: Receives errors while the plugin initializes or updates a chart.

Supported charts

The plugin supports Chart.js bar, line, pie, doughnut, polar area, and scatter charts, including mixed bar/line configurations. It also supports:

Visual-only Chart.js settings such as color, padding, and line thickness do not affect the sonification. Advanced Chart.js parsing configurations and nonstandard axis identifiers are not currently supported.

Future support

Planned support includes:

Examples and Storybook

The repository includes runnable chart configurations under stories/charts, covering the supported chart types and plugin integrations. A Storybook catalogue exposes these examples as Bar, Line, Multi-chart, Distribution, Circular, Scatter, Matrix, Word cloud, and Options stories.

npm run storybook

Build the static Storybook site with:

npm run build-storybook

More examples are available in the CodePen collection.

Development

npm test
npm run build
npm run depcheck