     data.lodByChr[chr] = []
     for pos,j in data.pos
       data.posByChr[chr].push(pos) if data.chr[j] == chr
-      data.lodByChr[chr].push(data.lod[j]) if data.chr[j] == chr
+      data.lodByChr[chr].push(data[lodvarname][j]) if data.chr[j] == chr
   data.markers = []
   for marker,i in data.markernames
     if marker != ""
-      data.markers.push({name:marker, chr:data.chr[i], pos:data.pos[i], lod:data.lod[i]}) 
+      data.markers.push({name:marker, chr:data.chr[i], pos:data.pos[i], lod:data[lodvarname][i]}) 
   data
 
 # calculate chromosome start/end + scales

    ylab = value
    chart

  chart.yscale = () ->
    return yscale


  yscale = d3.scale.linear()
  xscale = null
  lodcurve = null
  lodvarname = "lod"

  ## the main function
  chart = (selection) ->
    selection.each (data) ->
      if !(ylim?)
        ylim = [0, d3.max(data[lodvarname])]

      # Select the svg element, if it exists.
      svg = d3.select(this).selectAll("svg").data([data])
