class Scruffy::Components::XLegend

Public Instance Methods

draw(svg, bounds, options={}) click to toggle source
# File lib/scruffy/components/legend.rb, line 4
def draw(svg, bounds, options={})
  if options[:title]
    svg.text(options[:x_legend],
             :class => 'title',
    :x => (bounds[:width] / 2),
    :y => bounds[:height], 
        'font-size' => options[:theme].legend_font_size || relative(100),
        'font-family' => options[:theme].font_family,
    :fill => options[:theme].marker,
    :stroke => 'none', 'stroke-width' => '0',
        'text-anchor' => (@options[:text_anchor] || 'middle'))
  end
end