Socket
Socket
Sign inDemoInstall

Chart.CallBack.js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Chart.CallBack.js

Easiest way to add callbacks to your Chartjs instance


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Chart.Callback.js

A plugin to add callbacks to your Chartjs instance.

It is useful to make charts more interactive, like getting range when zooming in/out

Configuration

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) { }
		}
	}
}

Installation

To download a zip, go to the Chart.Callback.js on Github

TODO

To install via npm :

npm install Chart.Callback.js --save

Documentation

You can find documentation for Chart.js at www.chartjs.org/docs.

Examples for this plugin are available in the samples folder.

Contributing

Before submitting an issue or a pull request to the project, please take a moment to look over the contributing guidelines first.

License

Chart.Callback.js is available under the MIT license.

FAQs

Package last updated on 29 Jul 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc