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
{
"shasum": "607fabb99f5f8bfc8864b728300d2e62afbe8d52",
"tarball": "https://registry.npmjs.org/@01coder/chartjs-plugin-selectdrag/-/chartjs-plugin-selectdrag-2.0.0.tgz",
"fileCount": 10,
"integrity": "sha512-rJTF39jqxeLbKaPyfBskQ0+hvbqzmyeAb59qLzk4QMbVHqyrynB6JZnU3Za/pgq+JsquDXWMlb/qRPcrNYu7CQ==",
"signatures": [
{
"sig": "MEQCIDeNzHI/jD59nR6ykRn7qv02j0Xm0LjuTjp8yw75+FlWAiBKKWSye3Q/h8kwTsAywOcKLXSd0XAzyUhmN6BE9BO8HQ==",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 21761
}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:d975ff4f340e64be7d7d4cfeb6da84b205e720c4607fdde03d622c896b8946f4