Catalog npm
Back to packageRELEASE DETAILS

2.0.4

npm

@01coder/chartjs-plugin-selectdrag

Chartjs plugin which allows you to select a range of data by dragging over a chart

brushchartjsdragrangeselect
Published26 Aug 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

Chart JS Plugin Select Drag

Chartjs plugin which allows you to select a range of data by dragging over a chart, see example https://stackblitz.com/edit/chartjs-selectdrag?file=index.html

Usage

Register the plugin with chart js...

import Chart from "chart.js/auto";
import SelectDragPlugin from "@01coder/chartjs-plugin-selectdrag";
Chart.register(SelectDragPlugin);

Enable it in the settings of a chart

type: "bar",
options: {
  plugins: {
        selectdrag: {
            enabled: true,
            output: 'value', // Can be 'value' or 'label'
            highlight: false, // Highlight the selected data on the chart?
            colors: {
                selection: "#e8eff6", // Background color of selection box
                selected: "#1f77b4", // Color of selected data
                unselected: "#cccccc" // Color of unselected data
            },
            onSelectComplete: (event) => {
                // Show selected
                document.getElementById('results').innerHTML = event.range;

                // Get selected range
                console.log(event.range);
                
                // Get selection coordinates
                console.log(event.boundingBox);
            }
        }
    },
},
data: { 
    labels: [], 
    datasets: []
}

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
chart.js
Environment
{
  "local_name": "chart.js",
  "alias": false,
  "peer_metadata": null
}
^4.4.8development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.8.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-xQ2e7CTwq4/7ygJBNHU80xby+QHEM7S+5QNZ/FxCsS7iBzpUJyDbGLmYjkMVuamXj6nZRPoiqozlwGs6LiXNlA==",
  "shasum": "a4c9efb18c5c01c306a6d0883303df983599e0e0",
  "tarball": "https://registry.npmjs.org/@01coder/chartjs-plugin-selectdrag/-/chartjs-plugin-selectdrag-2.0.4.tgz",
  "fileCount": 10,
  "unpackedSize": 23040,
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEUCIF+hv2kyvBQVUNeciDTbkzF/QMUY48TlZQEmjyTc9nO0AiEA1LEI1CUHBcpAOgSefQ9E2MF58xRrx3wEqU2uBdeT03o="
    }
  ]
}

Repository

PENDING
01codelt/chartjs-plugin-selectdrag

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c998f726d6ee8b2d0944c023aa00a290440f3e1608530685fea08bddd5af35ed

Other collected versions

2.0.32 Feb2.0.218 Nov2.0.113 May2.0.016 Apr1.0.431 Mar1.0.35 FebView all collected versions →