vendors/chartnew/mathFunctions.js
/**
	 * Draw a deviation vertical line (if needed with top and bottom horizontal lines)
	 * @param i {integer} dataset number
	 * @param deviationFct {string} math function name
	 */
Draw a deviation vertical line (if needed with top and bottom horizontal lines)
@param i {integer} dataset number
@param deviationFct {string} math function name
Draw a deviation vertical line ( if needed with top and bottom horizontal lines ) @param i { integer } dataset number @param deviationFct { string } math function name
function drawMathDeviation(i,deviationFct) {
		var deviationVal = 0;
		if (typeof eval(deviationFct) == "function") {
			var parameter = {data:data,datasetNr: i};
			deviationVal = window[deviationFct](parameter);
		 }
		for (var j = 0; j < data.datasets[i].data.length; j++) {
			if(typeof deviationVal=="object") deviation=deviationVal[Math.min(deviationVal.length,j)];
			else deviation=deviationVal;
			if (isNumber(deviation)) {
				ctx.strokeStyle= data.datasets[i].deviationStrokeColor ? data.datasets[i].deviationStrokeColor : config.defaultStrokeColor;
				ctx.lineWidth = config.datasetStrokeWidth;
				ctx.beginPath();
				if (!(typeof(data.datasets[i].data[j])=='undefined')) {
					var deviationWidth = data.datasets[i].deviationWidth;
					if (deviationWidth) {
						ctx.moveTo(xPos(j,i,barWidth,barBool)-deviationWidth,yPos(i,j,-deviation,true));
						ctx.lineTo(xPos(j,i,barWidth,barBool)+deviationWidth,yPos(i,j,-deviation,true));
						ctx.moveTo(xPos(j,i,barWidth,barBool)-deviationWidth,yPos(i,j,deviation,true));
						ctx.lineTo(xPos(j,i,barWidth,barBool)+deviationWidth,yPos(i,j,deviation,true));
					}
					ctx.moveTo(xPos(j,i,barWidth,barBool),yPos(i,j,-deviation,true));
					ctx.lineTo(xPos(j,i,barWidth,barBool),yPos(i,j,deviation,true));
				}
				ctx.stroke();
				ctx.closePath();
			}
		}
	}
function drawMathDeviation ( i , deviationFct ) { var deviationVal = 0 ; if ( typeof eval ( deviationFct ) == "function" ) { var parameter = { data : data , datasetNr : i } ; deviationVal = window [ deviationFct ] ( parameter ) ; } for ( var j = 0 ; j < data . datasets [ i ] . data . length ; j ++ ) { if ( typeof deviationVal == "object" ) deviation = deviationVal [ Math . min ( deviationVal . length , j ) ] ; else deviation = deviationVal ; if ( isNumber ( deviation ) ) { ctx . strokeStyle = data . datasets [ i ] . deviationStrokeColor ? data . datasets [ i ] . deviationStrokeColor : config . defaultStrokeColor ; ctx . lineWidth = config . datasetStrokeWidth ; ctx . beginPath ( ) ; if ( ! ( typeof ( data . datasets [ i ] . data [ j ] ) == 'undefined' ) ) { var deviationWidth = data . datasets [ i ] . deviationWidth ; if ( deviationWidth ) { ctx . moveTo ( xPos ( j , i , barWidth , barBool ) - deviationWidth , yPos ( i , j , - deviation , true ) ) ; ctx . lineTo ( xPos ( j , i , barWidth , barBool ) + deviationWidth , yPos ( i , j , - deviation , true ) ) ; ctx . moveTo ( xPos ( j , i , barWidth , barBool ) - deviationWidth , yPos ( i , j , deviation , true ) ) ; ctx . lineTo ( xPos ( j , i , barWidth , barBool ) + deviationWidth , yPos ( i , j , deviation , true ) ) ; } ctx . moveTo ( xPos ( j , i , barWidth , barBool ) , yPos ( i , j , - deviation , true ) ) ; ctx . lineTo ( xPos ( j , i , barWidth , barBool ) , yPos ( i , j , deviation , true ) ) ; } ctx . stroke ( ) ; ctx . closePath ( ) ; } } }
Draw a deviation vertical line (if needed with top and bottom horizontal lines)
 @param i {integer} dataset number
 @param deviationFct {string} math function name
Draw a deviation vertical line ( if needed with top and bottom horizontal lines ) @param i { integer } dataset number @param deviationFct { string } math function name
// check if the math function exists // important to check because missing values are possible // draw the top and the bottom of the vertical line if a deviationWidth exists // draw the vertical line