mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
1 line
No EOL
844 B
JavaScript
1 line
No EOL
844 B
JavaScript
define(["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype.TYPE="pie",b.prototype._doughnut=null,b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);return d.setDoughnut(c.doughnut),d},b.prototype.addSeries=function(b){if(null===b.getColor()){for(var c=[],d=this.getConfigColorSet()||a.prototype.COLORSET,e=0;e<b.getCount();e++)c.push(d[e%d.length]);b.setColors(c)}return a.prototype.addSeries.apply(this,arguments)},b.prototype.getDoughnut=function(){return this._doughnut},b.prototype.setDoughnut=function(a){this._doughnut=Boolean(a)},b.prototype._validateSeries=function(){if(this._series.length>=1)throw new Error("Pie charts only support one serie.");return a.prototype._validateSeries.apply(this,arguments)},b}); |