       .attr("width", graphWidth)
       .attr("height", graphHeight)
       .attr("class", "background")
+        
+    paddingFactor = 2
+              
+    #set different scale for each graph with padding factors for margins
+    xScale = d3.scale.linear().range([0, graphWidth - xPadding*paddingFactor ])
+    yScale = d3.scale.linear().range([graphHeight - yPadding*paddingFactor, 0])
+    
+    xMax = 0
+    yMax = 0
+    
+    xMax = setXScale(xScale, d)
+    yMax = setYScale(yScale, d)
 
     # create the dots for the scatter plot
     graph = base.append("g")
     graph.selectAll("circle")
       .data((d) -> d.values) #d now contains exp_ratio, ten_year_return, index
       .enter().append("circle") # the code below will execute for each attr on circle
-      .attr("cx", (d) -> xPadding + xScale(d.exp_ratio))
-      .attr("cy", (d) -> (graphHeight - yScale(d.ten_year_return) - yPadding))
+      .attr("cx", (d) -> xScale(d.exp_ratio) + xPadding)
+      .attr("cy", (d) -> yScale(d.ten_year_return) + yPadding)
       .attr("r", 2)
       .attr("fill", "orange")
       .attr("stroke", "gray")

  # expects 'data' to be accessible and set to our
  # data.
  # ---
  setScales = () ->
    #yMax = d3.max(data, (d) -> d3.max(d.values, (e) -> e.value)) #change to e.ten_year_return
		
    yMax = d3.max(data, (d) -> d3.max(d.values, (e) -> e.ten_year_return))
		
    # this scale is expanded past its max to provide some white space
    # on the top of the bars
    #yScale.domain([0,yMax + 500000]) #change yMax + 500000 to yMax + 5
		
    yScale.domain([0,yMax + 5]) #change yMax + 500000 to yMax + 5

    xMax = d3.max(data, (d) -> d3.max(d.values, (e) -> e.exp_ratio))
		
    xScale.domain([0,xMax + 0.5])

    # names = data[0].values.map (d) -> d.name
    # xScale.domain(names)

    selection.each (rawData) ->
      # store our data and set the scale domains
      data = rawData
      #setScales()
      #createLegend()

      # bind data to svg elements so there will be a svg for
