                     .style("top", (d3.event.pageY - 28) + "px")
         )
         .on("mouseout", (record) =>
+            @element.dispatchEvent(
+                new CustomEvent('recordMouseout', {
+                    detail: {
+                        dataset: dataset.id,
+                        start: record[0],
+                        end: record[1],
+                        params: record[2]
+                    }
+                    bubbles: true,
+                    cancelable: true
+                })
+            )
             @tooltip.transition()
                 .duration(500)
                 .style("opacity", 0)

                else
                    return @scales.x(new Date(a))
            )
            .attr('cy', - (@options.ticksize + 3) * index - (@options.ticksize - 2) / 2)
            .attr('stroke', d3.rgb(color).darker())
            .attr('stroke-width', 1)
            .attr('r', @options.ticksize / 2)
            .call((recordElement) => @setupRecord(recordElement, color))

        p.exit().remove()

    drawPaths: (datasetElement, data, index, color) ->
        @scales.y.domain(d3.extent(data, (d) -> d[1]))

        datasetElement.selectAll('path').remove()


        datasetElement.append("g")
            .attr("class", "y axis")
            .attr('fill', dataset.color)
            .call(@axis.y)
            .attr("transform", "translate("+((dataset.index+1)*30)+","+ (-@options.height+29)+")")

        datasetElement.selectAll('.axis .domain')
            .attr("stroke-width", "1")
            .attr("stroke", dataset.color)
            .attr("shape-rendering", "crispEdges")
            .attr("fill", "none")

        datasetElement.selectAll('.axis line')
            .attr("stroke-width", "1")
            .attr("shape-rendering", "crispEdges")
            .attr("stroke", dataset.color)

        datasetElement.selectAll('.axis path')
            .attr("stroke-width", "1")
            .attr("shape-rendering", "crispEdges")
            .attr("stroke", dataset.color)

    # this function acually draws a dataset

