 # Dataset utility class for internal use only
 class Dataset
     constructor: (options) ->
-        { @id,  @color, @source, @sourceParams, @index, @records, @paths, @lineplot, @ordinal, @element } = options
+        { @id,  @color, @source, @sourceParams, @index, @records, @paths, @lineplot, @ordinal, @element, @histogram } = options
         @syncDebounced = debounce(@sync, options.debounceTime)
 
     getSource: ->

            )
        )

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


        if paths and paths.length
            @drawPaths(dataset.element, dataset, paths)
        else if records and records.length
            data = records.map((record) =>
                new Date(record[0] + (record[1] - record[0]) / 2)
            )
            if dataset.histogram
                @drawHistogram(dataset.element, dataset, records)
            else
                points = records.filter((record) =>
                    (@scales.x(new Date(record[1])) - @scales.x(new Date(record[0]))) < 5
                )
                ranges = records.filter((record) =>
                    (@scales.x(new Date(record[1])) - @scales.x(new Date(record[0]))) >= 5
                )
                @drawRanges(dataset.element, dataset, ranges)
                @drawPoints(dataset.element, dataset, points)

    # this function triggers the reloading of a dataset (sync)

