Socket
Socket
Sign inDemoInstall

@01coder/chartjs-plugin-selectdrag

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@01coder/chartjs-plugin-selectdrag

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


Version published
Maintainers
1
Weekly downloads
28
increased by12%

Weekly downloads

Readme

Source

chartjs-plugin-selectdrag

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

Usage

Register the plugin with chart js...

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

Enable it in the settings of a chart

{
    type: "bar",
    options: {
        plugins: {
            selectdrag: {
                enabled: true,
                onSelectComplete: (event) => { 
                    // Get selected range
                    console.log(event.range);
                    
                    // Get selection coordinates
                    console.log(event.boundingBox);
                }
            }
        },
    },
    data: { labels: [], datasets: [] }
});

Please note: This package is yet to be fully reviewed and tested, furthermore changes need to be made for other charts and selection types...

Keywords

FAQs

Last updated on 08 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc