                 .attr('y', 0)
 
         # datasets
-        @root.append('g')
+        @svg.append('g')
             .attr('class', 'datasets')
             .attr('width', @options.width)
             .attr('height', @options.height)
             .attr('transform', "translate(0, #{options.height - 18})")
 
         @drawDataset = (dataset) =>
-            @root.select('g.datasets')
+            @svg.select('g.datasets')
                 .append('g')
                     .attr('class', 'dataset')
                     .attr('id', "dataset-#{dataset.id}")
-            el = @root.select("g.datasets #dataset-#{dataset.id}")
+            el = @svg.select("g.datasets #dataset-#{dataset.id}")
             @options.datasetIndex = 0 unless @options.datasetIndex?
 
             @data[dataset.id] = {

            )
            .extent([@options.brush.start, @options.brush.end])

        @root.append('g')
            .attr('class', 'brush')
            .call(@brush)
            .selectAll('rect')

            @updateDataset(dataset.id)

        @updateDataset = (dataset) =>
            el = @svg.select("g.datasets #dataset-#{dataset}")
            d = @data[dataset]

            # update data
