!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("chart.js")):"function"==typeof define&&define.amd?define("primeng/chart",["exports","@angular/core","@angular/common","chart.js"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).primeng=t.primeng||{},t.primeng.chart={}),t.ng.core,t.ng.common,t.Chart)}(this,(function(t,e,n,i){"use strict";function r(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=r(i),a=function(){function t(t){this.el=t,this.plugins=[],this.responsive=!0,this.onDataSelect=new e.EventEmitter,this._options={}}return Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t,this.reinit()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t,this.reinit()},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){this.initChart(),this.initialized=!0},t.prototype.onCanvasClick=function(t){if(this.chart){var e=this.chart.getElementAtEvent(t),n=this.chart.getDatasetAtEvent(t);e&&e[0]&&n&&this.onDataSelect.emit({originalEvent:t,element:e[0],dataset:n})}},t.prototype.initChart=function(){var t=this.options||{};t.responsive=this.responsive,t.responsive&&(this.height||this.width)&&(t.maintainAspectRatio=!1),this.chart=new o(this.el.nativeElement.children[0].children[0],{type:this.type,data:this.data,options:this.options,plugins:this.plugins})},t.prototype.getCanvas=function(){return this.el.nativeElement.children[0].children[0]},t.prototype.getBase64Image=function(){return this.chart.toBase64Image()},t.prototype.generateLegend=function(){if(this.chart)return this.chart.generateLegend()},t.prototype.refresh=function(){this.chart&&this.chart.update()},t.prototype.reinit=function(){this.chart&&(this.chart.destroy(),this.initChart())},t.prototype.ngOnDestroy=function(){this.chart&&(this.chart.destroy(),this.initialized=!1,this.chart=null)},t}();a.decorators=[{type:e.Component,args:[{selector:"p-chart",template:'\n