Update api.md (#8701)

Add clarification that you can pass type and quality options
This commit is contained in:
Jacco van den Berg 2021-03-23 13:27:07 +01:00 committed by GitHub
parent 2fc98ddc39
commit 8ed689877f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,13 +85,16 @@ myLineChart.clear();
// => returns 'this' for chainability
```
## .toBase64Image()
## .toBase64Image(type?, quality?)
This returns a base 64 encoded string of the chart in its current state.
```javascript
myLineChart.toBase64Image();
// => returns png data url of the image on the canvas
myLineChart.toBase64Image('image/jpeg', 1)
// => returns a jpeg data url in the highest quality of the canvas
```
## .getElementsAtEventForMode(e, mode, options, useFinalPosition)