function getBackgroundPoint(vm, size, alignment, chart) {
	// Background Position
	var x = vm.x;
	var y = vm.y;

	var caretSize = vm.caretSize;
	var caretPadding = vm.caretPadding;
	var cornerRadius = vm.cornerRadius;
	var xAlign = alignment.xAlign;
	var yAlign = alignment.yAlign;
	var paddingAndSize = caretSize + caretPadding;
	var radiusAndPadding = cornerRadius + caretPadding;

	if (xAlign === 'right') {
		x -= size.width;
	} else if (xAlign === 'center') {
		x -= (size.width / 2);
		if (x + size.width > chart.width) {
			x = chart.width - size.width;
		}
		if (x < 0) {
			x = 0;
		}
	}

	if (yAlign === 'top') {
		y += paddingAndSize;
	} else if (yAlign === 'bottom') {
		y -= size.height + paddingAndSize;
	} else {
		y -= (size.height / 2);
	}

	if (yAlign === 'center') {
		if (xAlign === 'left') {
			x += paddingAndSize;
		} else if (xAlign === 'right') {
			x -= paddingAndSize;
		}
	} else if (xAlign === 'left') {
		x -= radiusAndPadding;
	} else if (xAlign === 'right') {
		x += radiusAndPadding;
	}

	return {
		x: x,
		y: y
	};
}
function getBackgroundPoint(vm, size, alignment, chart) {
	// Background Position
	var x = vm.x;
	var y = vm.y;

	var caretSize = vm.caretSize;
	var caretPadding = vm.caretPadding;
	var cornerRadius = vm.cornerRadius;
	var xAlign = alignment.xAlign;
	var yAlign = alignment.yAlign;
	var paddingAndSize = caretSize + caretPadding;
	var radiusAndPadding = cornerRadius + caretPadding;

	if (xAlign === 'right') {
		x -= size.width;
	} else if (xAlign === 'center') {
		x -= (size.width / 2);
		if (x + size.width > chart.width) {
			x = chart.width - size.width;
		}
		if (x < 0) {
			x = 0;
		}
	}

	if (yAlign === 'top') {
		y += paddingAndSize;
	} else if (yAlign === 'bottom') {
		y -= size.height + paddingAndSize;
	} else {
		y -= (size.height / 2);
	}

	if (yAlign === 'center') {
		if (xAlign === 'left') {
			x += paddingAndSize;
		} else if (xAlign === 'right') {
			x -= paddingAndSize;
		}
	} else if (xAlign === 'left') {
		x -= radiusAndPadding;
	} else if (xAlign === 'right') {
		x += radiusAndPadding;
	}

	return {
		x: x,
		y: y
	};
}
function getBackgroundPoint ( vm , size , alignment , chart ) { // Background Position var x = vm . x ; var y = vm . y ; var caretSize = vm . caretSize ; var caretPadding = vm . caretPadding ; var cornerRadius = vm . cornerRadius ; var xAlign = alignment . xAlign ; var yAlign = alignment . yAlign ; var paddingAndSize = caretSize + caretPadding ; var radiusAndPadding = cornerRadius + caretPadding ; if ( xAlign === 'right' ) { x -= size . width ; } else if ( xAlign === 'center' ) { x -= ( size . width / 2 ) ; if ( x + size . width > chart . width ) { x = chart . width - size . width ; } if ( x < 0 ) { x = 0 ; } } if ( yAlign === 'top' ) { y += paddingAndSize ; } else if ( yAlign === 'bottom' ) { y -= size . height + paddingAndSize ; } else { y -= ( size . height / 2 ) ; } if ( yAlign === 'center' ) { if ( xAlign === 'left' ) { x += paddingAndSize ; } else if ( xAlign === 'right' ) { x -= paddingAndSize ; } } else if ( xAlign === 'left' ) { x -= radiusAndPadding ; } else if ( xAlign === 'right' ) { x += radiusAndPadding ; } return { x : x , y : y } ; }
Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment
Helper to get the location a tooltip needs to be placed at given the initial position ( via the vm ) and the size and alignment
Get background position