Files
boc/landvex-admin-v2/node_modules/chartjs-node-canvas/dist/backgroundColourPlugin.js
T

21 lines
744 B
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackgroundColourPlugin = void 0;
class BackgroundColourPlugin {
constructor(_width, _height, _fillStyle) {
this._width = _width;
this._height = _height;
this._fillStyle = _fillStyle;
this.id = 'chartjs-plugin-chartjs-node-canvas-background-colour';
}
beforeDraw(chart) {
const ctx = chart.ctx;
ctx.save();
ctx.globalCompositeOperation = 'destination-over';
ctx.fillStyle = this._fillStyle;
ctx.fillRect(0, 0, this._width, this._height);
ctx.restore();
}
}
exports.BackgroundColourPlugin = BackgroundColourPlugin;
//# sourceMappingURL=backgroundColourPlugin.js.map