Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Chart.CallBack.js
Advanced tools
A plugin to add callbacks to your Chartjs instance.
It is useful to make charts more interactive, like getting range when zooming in/out
To configure the Callback plugin, you can simply add new config options to your chart config. Remember only add callbacks that are important to you. Remove the callbacks which you are not using.
{
type: 'bar',
data: barChartData,
options: {
{
// Container for callbacks options
chartCallBacks: {
beforeInit: function(chartInstance) { },
afterInit: function(chartInstance) { },
resize: function(chartInstance, newChartSize) { },
beforeUpdate: function(chartInstance) { },
afterScaleUpdate: function(chartInstance) { }
beforeDatasetsUpdate: function(chartInstance) { }
afterDatasetsUpdate: function(chartInstance) { }
//this is useful after resize/zoom operation is complete
afterUpdate: function(chartInstance) { },
// This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw
// to do something on each animation frame
beforeRender: function(chartInstance) { },
// Easing is for animation
beforeDraw: function(chartInstance, easing) { },
afterDraw: function(chartInstance, easing) { },
// Before the datasets are drawn but after scales are drawn
beforeDatasetsDraw: function(chartInstance, easing) { },
afterDatasetsDraw: function(chartInstance, easing) { },
destroy: function(chartInstance) { }
}
}
}
To download a zip, go to the Chart.Callback.js on Github
To install via npm :
npm install Chart.Callback.js --save
You can find documentation for Chart.js at www.chartjs.org/docs.
Examples for this plugin are available in the samples folder.
Before submitting an issue or a pull request to the project, please take a moment to look over the contributing guidelines first.
Chart.Callback.js is available under the MIT license.
FAQs
Easiest way to add callbacks to your Chartjs instance
The npm package Chart.CallBack.js receives a total of 0 weekly downloads. As such, Chart.CallBack.js popularity was classified as not popular.
We found that Chart.CallBack.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.