def render(options = {})
      options[:theme]               ||= theme
      options[:value_formatter]     ||= value_formatter
      options[:key_formatter]       ||= key_formatter
      options[:point_markers]       ||= point_markers
      options[:point_markers_rotation]       ||= point_markers_rotation
      options[:point_markers_ticks]       ||= point_markers_ticks
      options[:size]                ||= (options[:width] ? [options[:width], (options.delete(:width) * 0.6).to_i] : [600, 360])
      options[:title]               ||= title
      options[:x_legend]               ||= x_legend
      options[:y_legend]               ||= y_legend
      options[:layers]              ||= layers
      options[:min_value]           ||= bottom_value(options[:padding] ? options[:padding] : nil)
      options[:max_value]           ||= top_value(options[:padding] ? options[:padding] : nil)
      options[:min_key]             ||= bottom_key
      options[:max_key]             ||= top_key
      options[:graph]               ||= self

      # Removed for now.
      # Added for making smaller fonts more legible, but may not be needed after all.
      #
      # if options[:as] && (options[:size][0] <= 300 || options[:size][1] <= 200)
      #   options[:actual_size] = options[:size]
      #   options[:size] = [800, (800.to_f * (options[:actual_size][1].to_f / options[:actual_size][0].to_f))]
      # end
      
      svg = ( options[:renderer].nil? ? self.renderer.render( options ) : options[:renderer].render( options ) )
      
      # SVG to file.
      if options[:to] && options[:as].nil?
        File.open(options[:to], 'w') { |file|
          file.write(svg)
        }
      end
      
      options[:as] ? rasterizer.rasterize(svg, options) : svg
    end
def render(options = {})
      options[:theme]               ||= theme
      options[:value_formatter]     ||= value_formatter
      options[:key_formatter]       ||= key_formatter
      options[:point_markers]       ||= point_markers
      options[:point_markers_rotation]       ||= point_markers_rotation
      options[:point_markers_ticks]       ||= point_markers_ticks
      options[:size]                ||= (options[:width] ? [options[:width], (options.delete(:width) * 0.6).to_i] : [600, 360])
      options[:title]               ||= title
      options[:x_legend]               ||= x_legend
      options[:y_legend]               ||= y_legend
      options[:layers]              ||= layers
      options[:min_value]           ||= bottom_value(options[:padding] ? options[:padding] : nil)
      options[:max_value]           ||= top_value(options[:padding] ? options[:padding] : nil)
      options[:min_key]             ||= bottom_key
      options[:max_key]             ||= top_key
      options[:graph]               ||= self

      # Removed for now.
      # Added for making smaller fonts more legible, but may not be needed after all.
      #
      # if options[:as] && (options[:size][0] <= 300 || options[:size][1] <= 200)
      #   options[:actual_size] = options[:size]
      #   options[:size] = [800, (800.to_f * (options[:actual_size][1].to_f / options[:actual_size][0].to_f))]
      # end
      
      svg = ( options[:renderer].nil? ? self.renderer.render( options ) : options[:renderer].render( options ) )
      
      # SVG to file.
      if options[:to] && options[:as].nil?
        File.open(options[:to], 'w') { |file|
          file.write(svg)
        }
      end
      
      options[:as] ? rasterizer.rasterize(svg, options) : svg
    end
Writer defined below
 Returns a new Graph.  You can optionally pass in a default graph type and an options hash.

   Graph.new           # New graph
   Graph.new(:line)    # New graph with default graph type of Line
   Graph.new({...})    # New graph with options.

 Options:

 title::  Graph's title
 x_legend :: Title for X Axis
 y_legend :: Title for Y Axis
 theme::  A theme object to use when rendering graph
 layers::  An array of Layers for this graph to use
 default_type::  A symbol indicating the default type of Layer for this graph
 value_formatter::   Sets a formatter used to modify marker values prior to rendering
 point_markers::  Sets the x-axis marker values
 point_markers_rotation::  Sets the angle of rotation for x-axis marker values
 point_markers_ticks::  Sets a small tick mark above each marker value.  Helful when used with rotation.
 rasterizer::  Sets the rasterizer to use when rendering to an image format.  Defaults to RMagick.
 Renders the graph in it's current state to an SVG object.

 Options:
 size:: An array indicating the size you wish to render the graph.  ( [x, y] )
 width:: The width of the rendered graph.  A height is calculated at 3/4th of the width.
 theme:: Theme used to render graph for this render only.
 min_value:: Overrides the calculated minimum value used for the graph.
 max_value:: Overrides the calculated maximum value used for the graph.
 renderer:: Provide a Renderer object to use instead of the default.

 For other image formats:
 as:: File format to render to ('PNG', 'JPG', etc)
 to:: Name of file to save graph to, if desired.  If not provided, image is returned as blob/string.