Current collected state Current
Observed since 20 Oct, 21:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@01coder/chartjs-plugin-selectdrag
Chartjs plugin which allows you to select a range of data by dragging over a chart
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
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: []
}
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
chart.jsEnvironment{
"local_name": "chart.js",
"alias": false,
"peer_metadata": null
} | ^4.4.8 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^4.8.2 | development |
Source distribution
{
"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="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 21:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:c998f726d6ee8b2d0944c023aa00a290440f3e1608530685fea08bddd5af35ed