                 else
                     return @scales.x(new Date(a))
             )
-            .attr('cy', - (@options.ticksize + 3) * index - (@options.ticksize - 2) / 2)
-            .attr('stroke', d3.rgb(color).darker())
+            .attr('cy', - (@options.ticksize + 3) * dataset.index - (@options.ticksize - 2) / 2)
+            .attr('stroke', d3.rgb(dataset.color).darker())
             .attr('stroke-width', 1)
             .attr('r', @options.ticksize / 2)
-            .call((recordElement) => @setupRecord(recordElement, color))
+            .call((recordElement) => @setupRecord(recordElement, dataset))
 
         p.exit().remove()
 
-    drawPaths: (datasetElement, data, index, color) ->
+    drawPaths: (datasetElement, dataset, data) ->
         @scales.y.domain(d3.extent(data, (d) -> d[1]))
 
         datasetElement.selectAll('path').remove()

            @element.dispatchEvent(
                new CustomEvent('recordClicked', {
                    detail: {
                        start: record[0],
                        end: record[1],
                        params: record[2]

            )
        )

    drawRanges: (datasetElement, dataset, records) ->
        datasetElement.selectAll('rect').remove()

        r = datasetElement.selectAll('rect')
