Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Chart.js

You're reading from   Learn Chart.js Create interactive visualizations for the Web with Chart.js 2

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher
ISBN-13 9781789342482
Length 284 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Helder da Rocha Helder da Rocha
Author Profile Icon Helder da Rocha
Helder da Rocha
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introduction 2. Technology Fundamentals FREE CHAPTER 3. Chart.js - Quick Start 4. Creating Charts 5. Scales and Grid Configuration 6. Configuring Styles and Interactivity 7. Advanced Chart.js 8. Other Books You May Enjoy

Extending Chart.js


There are several ways to extend Chart.js. You may use the prototype methods, callbacks, and event handlers and interact with the rendering process; you can create plugins, which have their own life cycle and are easier to reuse in other charts; and you can extend Chart.js from existing charts or even create new charts and scales.

Prototype methods

Prototype methods are automatically called during rendering and updates. You can also call them directly if you need to interfere with the rendering process. They are listed in the following table:

Method

Description

destroy()

Destroys a chart instance. This can be used if you wish to reuse the canvas, or remove the chart completely.

reset()

Restores the chart to its initial state (after layout and before its initial animation). A new animation can be triggered with render() or update().

stop()

Stops an animation loop. This is usually called in an onProgress callback. Calling render() or update() will resume the animation.

clear()

Clears...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime