src/elements/element.rectangle.js
function getBarBounds(vm) {
	var x1, x2, y1, y2, half;

	if (isVertical(vm)) {
		half = vm.width / 2;
		x1 = vm.x - half;
		x2 = vm.x + half;
		y1 = Math.min(vm.y, vm.base);
		y2 = Math.max(vm.y, vm.base);
	} else {
		half = vm.height / 2;
		x1 = Math.min(vm.x, vm.base);
		x2 = Math.max(vm.x, vm.base);
		y1 = vm.y - half;
		y2 = vm.y + half;
	}

	return {
		left: x1,
		top: y1,
		right: x2,
		bottom: y2
	};
}
function getBarBounds(vm) {
	var x1, x2, y1, y2, half;

	if (isVertical(vm)) {
		half = vm.width / 2;
		x1 = vm.x - half;
		x2 = vm.x + half;
		y1 = Math.min(vm.y, vm.base);
		y2 = Math.max(vm.y, vm.base);
	} else {
		half = vm.height / 2;
		x1 = Math.min(vm.x, vm.base);
		x2 = Math.max(vm.x, vm.base);
		y1 = vm.y - half;
		y2 = vm.y + half;
	}

	return {
		left: x1,
		top: y1,
		right: x2,
		bottom: y2
	};
}
function getBarBounds ( vm ) { var x1 , x2 , y1 , y2 , half ; if ( isVertical ( vm ) ) { half = vm . width / 2 ; x1 = vm . x - half ; x2 = vm . x + half ; y1 = Math . min ( vm . y , vm . base ) ; y2 = Math . max ( vm . y , vm . base ) ; } else { half = vm . height / 2 ; x1 = Math . min ( vm . x , vm . base ) ; x2 = Math . max ( vm . x , vm . base ) ; y1 = vm . y - half ; y2 = vm . y + half ; } return { left : x1 , top : y1 , right : x2 , bottom : y2 } ; }
Helper function to get the bounds of the bar regardless of the orientation
@param bar {Chart.Element.Rectangle} the bar
@return {Bounds} bounds of the bar
@private
Helper function to get the bounds of the bar regardless of the orientation