src/controllers/controller.bar.js
function(datasetIndex, name) {
		var stacks = this._getStacks(datasetIndex);
		var index = (name !== undefined)
			? stacks.indexOf(name)
			: -1; // indexOf returns -1 if element is not present

		return (index === -1)
			? stacks.length - 1
			: index;
	}
function(datasetIndex, name) {
		var stacks = this._getStacks(datasetIndex);
		var index = (name !== undefined)
			? stacks.indexOf(name)
			: -1; // indexOf returns -1 if element is not present

		return (index === -1)
			? stacks.length - 1
			: index;
	}
function ( datasetIndex , name ) { var stacks = this . _getStacks ( datasetIndex ) ; var index = ( name !== undefined ) ? stacks . indexOf ( name ) : - 1 ; // indexOf returns -1 if element is not present return ( index === - 1 ) ? stacks . length - 1 : index ; }
Returns the stack index for the given dataset based on groups and bar visibility.
@param {number} [datasetIndex] - The dataset index
@param {string} [name] - The stack name to find
@returns {number} The stack index
@private
Returns the stack index for the given dataset based on groups and bar visibility .