Your IP : 192.168.165.1


Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/
Upload File :
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/chart_series.min.js

function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/chart_series",[],function(){function a(a,b){if("string"!=typeof a){throw new Error("Invalid label for series.")}else if("object"!==_typeof(b)){throw new Error("Values for a series must be an array.")}else if(1>b.length){throw new Error("Invalid values received for series.")}this._colors=[];this._label=a;this._values=b}a.prototype.TYPE_DEFAULT=null;a.prototype.TYPE_LINE="line";a.prototype._colors=null;a.prototype._fill=!1;a.prototype._label=null;a.prototype._labels=null;a.prototype._smooth=!1;a.prototype._type=a.prototype.TYPE_DEFAULT;a.prototype._values=null;a.prototype._xaxis=null;a.prototype._yaxis=null;a.prototype.create=function(b){var c=new a(b.label,b.values);c.setType(b.type);c.setXAxis(b.axes.x);c.setYAxis(b.axes.y);c.setLabels(b.labels);if(b.colors&&1<b.colors.length){c.setColors(b.colors)}else{c.setColor(b.colors[0])}c.setFill(b.fill);c.setSmooth(b.smooth);return c};a.prototype.getColor=function(){return this._colors[0]||null};a.prototype.getColors=function(){return this._colors};a.prototype.getCount=function(){return this._values.length};a.prototype.getFill=function(){return this._fill};a.prototype.getLabel=function(){return this._label};a.prototype.getLabels=function(){return this._labels};a.prototype.getSmooth=function(){return this._smooth};a.prototype.getType=function(){return this._type};a.prototype.getValues=function(){return this._values};a.prototype.getXAxis=function(){return this._xaxis};a.prototype.getYAxis=function(){return this._yaxis};a.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()};a.prototype.setColor=function(a){this._colors=[a]};a.prototype.setColors=function(a){if(a&&a.length!=this.getCount()){throw new Error("When setting multiple colors there must be one per value.")}this._colors=a||[]};a.prototype.setFill=function(a){this._fill="undefined"==typeof a?null:a};a.prototype.setLabels=function(a){this._validateLabels(a);a="undefined"==typeof a?null:a;this._labels=a};a.prototype.setSmooth=function(a){a="undefined"==typeof a?null:a;this._smooth=a};a.prototype.setType=function(a){if(a!=this.TYPE_DEFAULT&&a!=this.TYPE_LINE){throw new Error("Invalid serie type.")}this._type=a||null};a.prototype.setXAxis=function(a){this._xaxis=a||null};a.prototype.setYAxis=function(a){this._yaxis=a||null};a.prototype._validateLabels=function(a){if(a&&0<a.length&&a.length!=this.getCount()){throw new Error("Series labels must match series values.")}};return a});
//# sourceMappingURL=chart_series.min.js.map