MDL-55030 core: Bar charts defaults to using a Y axis starting at 0
Part of MDL-54987 epic.
This commit is contained in:
committed by
Dan Poltawski
parent
826ade18f1
commit
299e9aba66
Vendored
+1
-1
@@ -1 +1 @@
|
||||
define(["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype.TYPE="bar",b});
|
||||
define(["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype.TYPE="bar",b.prototype._setDefaults=function(){a.prototype._setDefaults.apply(this,arguments);var b=this.getYAxis(0,!0);b.setMin(0)},b});
|
||||
@@ -32,6 +32,12 @@ define(['core/chart_base'], function(Base) {
|
||||
|
||||
Bar.prototype.TYPE = 'bar';
|
||||
|
||||
Bar.prototype._setDefaults = function() {
|
||||
Base.prototype._setDefaults.apply(this, arguments);
|
||||
var axis = this.getYAxis(0, true);
|
||||
axis.setMin(0);
|
||||
};
|
||||
|
||||
return Bar;
|
||||
|
||||
});
|
||||
|
||||
@@ -33,4 +33,11 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class chart_bar extends chart_base {
|
||||
|
||||
protected function set_defaults() {
|
||||
parent::set_defaults();
|
||||
$yaxis = $this->get_yaxis(0, true);
|
||||
$yaxis->set_min(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user