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_base.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_base",["core/chart_series","core/chart_axis"],function(a,b){function c(){this._series=[];this._labels=[];this._xaxes=[];this._yaxes=[];this._setDefaults()}c.prototype._series=null;c.prototype._labels=null;c.prototype._legendOptions=null;c.prototype._title=null;c.prototype._xaxes=null;c.prototype._yaxes=null;c.prototype.COLORSET=["#f3c300","#875692","#f38400","#a1caf1","#be0032","#c2b280","#7f180d","#008856","#e68fac","#0067a5"];c.prototype._configColorSet=null;c.prototype.TYPE=null;c.prototype.addSeries=function(a){this._validateSeries(a);this._series.push(a);if(null===a.getColor()){var b=this.getConfigColorSet()||c.prototype.COLORSET;a.setColor(b[this._series.length%b.length])}};c.prototype.create=function(c,d){var e=new c;e.setConfigColorSet(d.config_colorset);e.setLabels(d.labels);e.setTitle(d.title);if(d.legend_options){e.setLegendOptions(d.legend_options)}d.series.forEach(function(b){e.addSeries(a.prototype.create(b))});d.axes.x.forEach(function(a,c){e.setXAxis(b.prototype.create(a),c)});d.axes.y.forEach(function(a,c){e.setYAxis(b.prototype.create(a),c)});return e};c.prototype.__getAxis=function(a,c,d){var e="x"===a?this._xaxes:this._yaxes,f=("x"===a?this.setXAxis:this.setYAxis).bind(this),g;c="undefined"==typeof c?0:c;d="undefined"==typeof d?!1:d;g=e[c];if("undefined"==typeof g){if(!d){throw new Error("Unknown axis.")}g=new b;f(g,c)}return g};c.prototype.getConfigColorSet=function(){return this._configColorSet};c.prototype.getLabels=function(){return this._labels};c.prototype.getLegendOptions=function(){return this._legendOptions};c.prototype.getSeries=function(){return this._series};c.prototype.getTitle=function(){return this._title};c.prototype.getType=function(){if(!this.TYPE){throw new Error("The TYPE property has not been set.")}return this.TYPE};c.prototype.getXAxes=function(){return this._xaxes};c.prototype.getXAxis=function(a,b){return this.__getAxis("x",a,b)};c.prototype.getYAxes=function(){return this._yaxes};c.prototype.getYAxis=function(a,b){return this.__getAxis("y",a,b)};c.prototype.setConfigColorSet=function(a){this._configColorSet=a};c.prototype._setDefaults=function(){};c.prototype.setLabels=function(a){if(a.length&&this._series.length&&this._series[0].length!=a.length){throw new Error("Series must match label values.")}this._labels=a};c.prototype.setLegendOptions=function(a){if("object"!==_typeof(a)){throw new Error("Setting legend with non-object value:"+a)}this._legendOptions=a};c.prototype.setTitle=function(a){this._title=a};c.prototype.setXAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("x",a,b);this._xaxes[b]=a};c.prototype.setYAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("y",a,b);this._yaxes[b]=a};c.prototype._validateAxis=function(a,b,c){c="undefined"==typeof c?0:c;if(0<c){var d="x"==a?this._xaxes:this._yaxes;if("undefined"==typeof d[c-1]){throw new Error("Missing "+a+" axis at index lower than "+c)}}};c.prototype._validateSeries=function(a){if(this._series.length&&this._series[0].getCount()!=a.getCount()){throw new Error("Series do not have an equal number of values.")}else if(this._labels.length&&this._labels.length!=a.getCount()){throw new Error("Series must match label values.")}};return c});
//# sourceMappingURL=chart_base.min.js.map