       d3.min(@data, (layer) -> d3.min(layer.values, cmp)),
       d3.max(@data, (layer) -> d3.max(layer.values, cmp))
     ]
+
+  # Updates the width and height members and container dimensions in response to an
+  # 'option:width' or 'option:height' event.
+  dimensionsChanged: ->
+    [@width, @height] = [@option('width'), @option('height')]
+    @el.attr('width', @width).attr('height', @height) if @el?
 
 
 # Base class for all SVG charts (via d3).

        width: @width,
        height: @height

# Base Class for all Canvas based charts.
class Epoch.Chart.Canvas extends Epoch.Chart.Base
  # Initializes the chart and places the rendering canvas in the specified

    width: 320
    height: 240

  optionListeners =
    'option:width': 'dimensionsChanged'
    'option:height': 'dimensionsChanged'

  # Creates a new base chart.
  # @param [Object] options Options to set for this chart.
  # @option options [Integer] width Sets an explicit width for the visualization (optional).
