From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Tue, 23 Mar 2021 12:27:07 +0000 (+0100) Subject: Update api.md (#8701) X-Git-Tag: v3.0.0-rc.3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ed689877fc236ddf723f1a12b04f6bce68d20c0;p=thirdparty%2FChart.js.git Update api.md (#8701) Add clarification that you can pass type and quality options --- diff --git a/docs/docs/developers/api.md b/docs/docs/developers/api.md index 0cb9841f1..f26f991a8 100644 --- a/docs/docs/developers/api.md +++ b/docs/docs/developers/api.md @@ -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)