anchor.diff:  			    });
   			}),
   	
  -			svg = d3.select(graphSelector)
  +			svg = d3.select(parentSelector)
   			    .append('svg')
   			        .attr('width', width + margins.left + margins.right)
   			        .attr('height', height + margins.top + margins.bottom + 60)
  
positive.code:         
          
  <script>
      //TODO:
  	  // 1. for the colors of each bar, what happens when we have more than 6 intervals?  We need the start color and then end color and then
  	     // we take the number of intervals and calculate the colors needed to get from the start color to the end color.
  	  // 2. the y axis label should not be given 
  	  // 3. the score is not showing up in the graph
         
      function graphStacked(graphId, graphObj, parentDiv){
          parentDiv.addClass("graphicBlock");
          
          var titleContainer = parentDiv.children(".moduleTemplateTitle");
          var graphContainer = parentDiv.children(".graphSection");
          var descriptionContainer = parentDiv.children(".moduleTemplateText");
      	  
  		// Load Objects
  		var graphparams = graphObj.data;
  		var graphStart 	= 0;
  		var graphEnd 	= graphparams.maxXPoint;
  		var ticks      	= graphparams.ticks;
  		
  		var legends = [];
  		var d3DataSet = [];
  		var scoresInterval;
  		var prevInterval, prevName;
  		$.each(graphparams.intervals, function(name, intervalStart){
  			legends.push(name);
  
  			//skip the first one
  			if(prevInterval != null){
  				d3DataSet.push([{x:"", y:intervalStart}]);
  			}
  			else{
  				graphStart = intervalStart;
  			}
  			
  			if(prevInterval != null && graphparams.score >= prevInterval && graphparams.score < intervalStart){
  				scoresInterval = prevName;
  		    }
  			prevInterval = intervalStart;
  			prevName = name;
  		}); 
  		//check if scoreInterval is in the last interval
  		if(scoresInterval == null && graphparams.score >= prevInterval){
  			scoresInterval = prevName;
  		}
  		
  		//if this is null then that means the final interval will end the graph (there must be a tick for this last point)
  		if(graphEnd != null){
  			d3DataSet.push([{x:"", y:graphEnd}]);
  		}
  		
  		// Update title block to contain the scoring
  		titleContainer.wrap("<div class='scoreBlock text-center'>");
  		titleContainer.parent().append("<div><h4>" + graphparams.score + "</h4><h5>" + scoresInterval + "</h5></div>");
  		
  		//Start adding to the graphic block with the graph's title 
  		graphContainer.prepend("<div class='graphHeader'>" + graphObj.title + "</div>"); 
  		
  		
  		//Add d3 graph
          var graphContainerId = "graph_" + graphId;
          var graphSelector = "#" + graphContainerId;
          graphContainer.children(".graphicBody").prop("id", graphContainerId)
          
          //Set d3 graph attributes
  	    var margins = {
  		          top: 46,
  
negative.code: 		$('.bars > rect').each(function () {
  			$(this).prependTo(this.parentNode);
  		});
  	}
  		
  </script>
  </html>