]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update api.md (#8701)
authorJacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
Tue, 23 Mar 2021 12:27:07 +0000 (13:27 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Mar 2021 12:27:07 +0000 (08:27 -0400)
Add clarification that you can pass type and quality options

docs/docs/developers/api.md

index 0cb9841f1d4f919434557b6530c9c6e11e03fca4..f26f991a8ff243c4186ffeaec1e652c6859b607c 100644 (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)