mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-04 07:24:02 +01:00
61 lines
823 B
JavaScript
61 lines
823 B
JavaScript
'use strict';
|
|
|
|
var BarController = require('./controller.bar');
|
|
var defaults = require('../core/core.defaults');
|
|
|
|
defaults._set('horizontalBar', {
|
|
hover: {
|
|
mode: 'index',
|
|
axis: 'y'
|
|
},
|
|
|
|
scales: {
|
|
x: {
|
|
type: 'linear',
|
|
position: 'bottom'
|
|
},
|
|
y: {
|
|
type: 'category',
|
|
position: 'left',
|
|
offset: true,
|
|
gridLines: {
|
|
offsetGridLines: true
|
|
}
|
|
}
|
|
},
|
|
|
|
elements: {
|
|
rectangle: {
|
|
borderSkipped: 'left'
|
|
}
|
|
},
|
|
|
|
tooltips: {
|
|
mode: 'index',
|
|
axis: 'y'
|
|
}
|
|
});
|
|
|
|
defaults._set('datasets', {
|
|
horizontalBar: {
|
|
categoryPercentage: 0.8,
|
|
barPercentage: 0.9
|
|
}
|
|
});
|
|
|
|
module.exports = BarController.extend({
|
|
/**
|
|
* @private
|
|
*/
|
|
_getValueScaleId: function() {
|
|
return this._cachedMeta.xAxisID;
|
|
},
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
_getIndexScaleId: function() {
|
|
return this._cachedMeta.yAxisID;
|
|
}
|
|
});
|