Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions canvas2svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,23 @@
}
};

/* Chart JS v4.2.1 Compatibility */
ctx.prototype.getContext = function (contextId) {
if (String(contextId).toUpperCase() === '2D') {
return this
}
return null
}
ctx.prototype.style = function () {
return this.__canvas.style
}
ctx.prototype.getAttribute = function (prop_name) {
return this[prop_name]
}
ctx.prototype.resetTransform = function () {
this.setTransform(1, 0, 0, 1, 0, 0);
}

/**
* Not yet implemented
*/
Expand All @@ -1200,6 +1217,8 @@
ctx.prototype.putImageData = function () {};
ctx.prototype.globalCompositeOperation = function () {};
ctx.prototype.setTransform = function () {};
ctx.prototype.resetTransform = function() {};
ctx.prototype.addEventListener = function (type, listener, eventListenerOptions) {};

//add options for alternative namespace
if (typeof window === "object") {
Expand Down