function drawHistoryCooler(newData) {
	var parseTime = d3.timeParse("%m-%d-%Y");
	newData.forEach(function(d, i) {
		d.name = parseTime(d.name);
		d.value = +d.value;
	});
	x.domain(d3.extent(newData, function(d) { return d.name; })).nice();
	y.domain([0, d3.max(newData, function(d) {
		return Math.max(d.value); })]).nice();

	svgHisCooler.call(tipHistory);
  
	svgHisCooler.append("g")			
		.attr("class", "grid")
		.attr("transform", "translate(0," + height + ")")
		.call(make_x_gridlines()
			.tickSize(-height)
			.tickFormat(""));
	svgHisCooler.append("g")			
		.attr("class", "grid")
		.call(make_y_gridlines()
			.tickSize(-width)
			.tickFormat(""));
	// Add alert light lines
	svgHisCooler.append("line")
		.style("stroke", "#42c77b")
		.attr("x1", 0).attr("y1", 0)
		.attr("x2", width).attr("y2", 0);
	svgHisCooler.append("line")
		.style("stroke", "#fbdd38")
		.attr("x1", 0).attr("y1", 148)
		.attr("x2", width).attr("y2", 148);
	svgHisCooler.append("line")
		.style("stroke", "#fb4f38")
		.attr("x1", 0).attr("y1", 180)
		.attr("x2", width).attr("y2", 180);
	// Add alert light texts
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 14)")
		.style("font-size", "12px")
		.style("fill", "#42c77b")
		.text("Full efficiency");
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 144)")
		.style("font-size", "12px")
		.style("fill", "#fbdd38")
		.text("Reduced efficiency");
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 176)")
		.style("font-size", "12px")
		.style("fill", "#fb4f38")
		.text("Close to total failure");
	// Add the valueline path.
	svgHisCooler.append("path")
		.data([newData])
		.attr("class", "line-history")
		.attr("d", valueline);
	// Add point to each data
	svgHisCooler.selectAll("dot")
		.data(newData)
		.enter()
		.append("circle")
		.attr("class", "line-circle")
		.attr("r", 4)
		.attr("cy", function(d) { return y(d.value); })
		.attr("cx", function(d) { return x(d.name); })
		.on('mouseover', tipHistory.show)
		.on('mouseout', tipHistory.hide);

	// Add the X Axis
	svgHisCooler.append("g")
		.attr("transform", "translate(0," + height + ")")
		.style("font-family", "Raleway")
		.style("font-size", "11px")
		.call(d3.axisBottom(x).tickFormat(d3.timeFormat("%b-%d")));
	// text label for the x axis
	svgHisCooler.append("text")
		.attr("transform", "translate(" + (width/2) + " ," + (height + margin.top + 28) + ")")
		.style("text-anchor", "middle")
		.style("font-size", "13px")
		.text("Time");
	// Add the Y Axis
	svgHisCooler.append("g")
		.style("font-family", "Raleway")
		.style("font-size", "11px")
		.call(d3.axisLeft(y).ticks(6));
	// text label for the y axis
	svgHisCooler.append("text")
		.attr("transform", "rotate(-90)")
		.attr("y", "-46px")
		.attr("x",0 - (height / 2))
		.attr("dy", "1em")
		.style("text-anchor", "middle")
		.style("font-size", "13px")
		.text("Condition");
}
/* 
	------------------------------------------------
	Name : drawHistoryCooler
	Desc : History - Cooler
	------------------------------------------------
*/
Name : drawHistoryCooler
Desc : History - Cooler
Name : drawHistoryCooler Desc : History - Cooler
function drawHistoryCooler(newData) {
	var parseTime = d3.timeParse("%m-%d-%Y");
	newData.forEach(function(d, i) {
		d.name = parseTime(d.name);
		d.value = +d.value;
	});
	x.domain(d3.extent(newData, function(d) { return d.name; })).nice();
	y.domain([0, d3.max(newData, function(d) {
		return Math.max(d.value); })]).nice();
	svgHisCooler.call(tipHistory);
	svgHisCooler.append("g")			
		.attr("class", "grid")
		.attr("transform", "translate(0," + height + ")")
		.call(make_x_gridlines()
			.tickSize(-height)
			.tickFormat(""));
	svgHisCooler.append("g")			
		.attr("class", "grid")
		.call(make_y_gridlines()
			.tickSize(-width)
			.tickFormat(""));
	svgHisCooler.append("line")
		.style("stroke", "#42c77b")
		.attr("x1", 0).attr("y1", 0)
		.attr("x2", width).attr("y2", 0);
	svgHisCooler.append("line")
		.style("stroke", "#fbdd38")
		.attr("x1", 0).attr("y1", 148)
		.attr("x2", width).attr("y2", 148);
	svgHisCooler.append("line")
		.style("stroke", "#fb4f38")
		.attr("x1", 0).attr("y1", 180)
		.attr("x2", width).attr("y2", 180);
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 14)")
		.style("font-size", "12px")
		.style("fill", "#42c77b")
		.text("Full efficiency");
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 144)")
		.style("font-size", "12px")
		.style("fill", "#fbdd38")
		.text("Reduced efficiency");
	svgHisCooler.append("text")
		.attr("transform", "translate(8 , 176)")
		.style("font-size", "12px")
		.style("fill", "#fb4f38")
		.text("Close to total failure");
	svgHisCooler.append("path")
		.data([newData])
		.attr("class", "line-history")
		.attr("d", valueline);
	svgHisCooler.selectAll("dot")
		.data(newData)
		.enter()
		.append("circle")
		.attr("class", "line-circle")
		.attr("r", 4)
		.attr("cy", function(d) { return y(d.value); })
		.attr("cx", function(d) { return x(d.name); })
		.on('mouseover', tipHistory.show)
		.on('mouseout', tipHistory.hide);
	svgHisCooler.append("g")
		.attr("transform", "translate(0," + height + ")")
		.style("font-family", "Raleway")
		.style("font-size", "11px")
		.call(d3.axisBottom(x).tickFormat(d3.timeFormat("%b-%d")));
	svgHisCooler.append("text")
		.attr("transform", "translate(" + (width/2) + " ," + (height + margin.top + 28) + ")")
		.style("text-anchor", "middle")
		.style("font-size", "13px")
		.text("Time");
	svgHisCooler.append("g")
		.style("font-family", "Raleway")
		.style("font-size", "11px")
		.call(d3.axisLeft(y).ticks(6));
	svgHisCooler.append("text")
		.attr("transform", "rotate(-90)")
		.attr("y", "-46px")
		.attr("x",0 - (height / 2))
		.attr("dy", "1em")
		.style("text-anchor", "middle")
		.style("font-size", "13px")
		.text("Condition");
}
function drawHistoryCooler ( newData ) { var parseTime = d3 . timeParse ( "%m-%d-%Y" ) ; newData . forEach ( function ( d , i ) { d . name = parseTime ( d . name ) ; d . value = + d . value ; } ) ; x . domain ( d3 . extent ( newData , function ( d ) { return d . name ; } ) ) . nice ( ) ; y . domain ( [ 0 , d3 . max ( newData , function ( d ) { return Math . max ( d . value ) ; } ) ] ) . nice ( ) ; svgHisCooler . call ( tipHistory ) ; svgHisCooler . append ( "g" ) . attr ( "class" , "grid" ) . attr ( "transform" , "translate(0," + height + ")" ) . call ( make_x_gridlines ( ) . tickSize ( - height ) . tickFormat ( "" ) ) ; svgHisCooler . append ( "g" ) . attr ( "class" , "grid" ) . call ( make_y_gridlines ( ) . tickSize ( - width ) . tickFormat ( "" ) ) ; svgHisCooler . append ( "line" ) . style ( "stroke" , "#42c77b" ) . attr ( "x1" , 0 ) . attr ( "y1" , 0 ) . attr ( "x2" , width ) . attr ( "y2" , 0 ) ; svgHisCooler . append ( "line" ) . style ( "stroke" , "#fbdd38" ) . attr ( "x1" , 0 ) . attr ( "y1" , 148 ) . attr ( "x2" , width ) . attr ( "y2" , 148 ) ; svgHisCooler . append ( "line" ) . style ( "stroke" , "#fb4f38" ) . attr ( "x1" , 0 ) . attr ( "y1" , 180 ) . attr ( "x2" , width ) . attr ( "y2" , 180 ) ; svgHisCooler . append ( "text" ) . attr ( "transform" , "translate(8 , 14)" ) . style ( "font-size" , "12px" ) . style ( "fill" , "#42c77b" ) . text ( "Full efficiency" ) ; svgHisCooler . append ( "text" ) . attr ( "transform" , "translate(8 , 144)" ) . style ( "font-size" , "12px" ) . style ( "fill" , "#fbdd38" ) . text ( "Reduced efficiency" ) ; svgHisCooler . append ( "text" ) . attr ( "transform" , "translate(8 , 176)" ) . style ( "font-size" , "12px" ) . style ( "fill" , "#fb4f38" ) . text ( "Close to total failure" ) ; svgHisCooler . append ( "path" ) . data ( [ newData ] ) . attr ( "class" , "line-history" ) . attr ( "d" , valueline ) ; svgHisCooler . selectAll ( "dot" ) . data ( newData ) . enter ( ) . append ( "circle" ) . attr ( "class" , "line-circle" ) . attr ( "r" , 4 ) . attr ( "cy" , function ( d ) { return y ( d . value ) ; } ) . attr ( "cx" , function ( d ) { return x ( d . name ) ; } ) . on ( 'mouseover' , tipHistory . show ) . on ( 'mouseout' , tipHistory . hide ) ; svgHisCooler . append ( "g" ) . attr ( "transform" , "translate(0," + height + ")" ) . style ( "font-family" , "Raleway" ) . style ( "font-size" , "11px" ) . call ( d3 . axisBottom ( x ) . tickFormat ( d3 . timeFormat ( "%b-%d" ) ) ) ; svgHisCooler . append ( "text" ) . attr ( "transform" , "translate(" + ( width / 2 ) + " ," + ( height + margin . top + 28 ) + ")" ) . style ( "text-anchor" , "middle" ) . style ( "font-size" , "13px" ) . text ( "Time" ) ; svgHisCooler . append ( "g" ) . style ( "font-family" , "Raleway" ) . style ( "font-size" , "11px" ) . call ( d3 . axisLeft ( y ) . ticks ( 6 ) ) ; svgHisCooler . append ( "text" ) . attr ( "transform" , "rotate(-90)" ) . attr ( "y" , "-46px" ) . attr ( "x" , 0 - ( height / 2 ) ) . attr ( "dy" , "1em" ) . style ( "text-anchor" , "middle" ) . style ( "font-size" , "13px" ) . text ( "Condition" ) ; }
Name : drawHistoryCooler
Desc : History - Cooler
Name : drawHistoryCooler Desc : History - Cooler
// Add alert light lines // Add alert light texts // Add the valueline path. // Add point to each data // Add the X Axis // text label for the x axis // Add the Y Axis // text label for the y axis