https://github.com/albinodrought/chartjs-plugin-title-click
Adds support for basic onClick and onHover events to the chartjs title
https://github.com/albinodrought/chartjs-plugin-title-click
chartjs
Last synced: 13 days ago
JSON representation
Adds support for basic onClick and onHover events to the chartjs title
- Host: GitHub
- URL: https://github.com/albinodrought/chartjs-plugin-title-click
- Owner: AlbinoDrought
- License: mit
- Created: 2017-04-11T17:28:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T15:39:57.000Z (almost 5 years ago)
- Last Synced: 2025-04-15T00:47:06.895Z (about 1 month ago)
- Topics: chartjs
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chartjs-plugin-title-click
A simple title onClick/onHover plugin for Chart.js
## Configuration
To configure the title click plugin, add these options to your chart config:
```javascript
{
title: {
onClick: function(e, titleBlock) {
console.log("Clicked title!");
},
onHover: function(e, titleBlock) {
console.log("Hovered title!");
},
onLeave: function(e, titleBlock) {
console.log("Leaved title!");
},
}
}
```## Installation
To use, download chartjs-plugin-titleclick.js and reference it in your project.
## Documentation
You can find documentation for the main plugin, Chart.js, at [www.chartjs.org/docs](http://www.chartjs.org/docs).
There are some samples for this plugin in the [samples folder](samples).
## License
chartjs-plugin-titleclick.js is available under the [MIT license](http://opensource.org/licenses/MIT).