Class: Scruffy::Components::XLegend
- Defined in:
- lib/scruffy/components/legend.rb
Instance Attribute Summary
Attributes inherited from Base
#id, #options, #position, #size, #visible
Instance Method Summary collapse
Methods inherited from Base
#initialize, #process, #render
Constructor Details
This class inherits a constructor from Scruffy::Components::Base
Instance Method Details
#draw(svg, bounds, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/scruffy/components/legend.rb', line 4 def draw(svg, bounds, ={}) if [:title] svg.text([:x_legend], :class => 'title', :x => (bounds[:width] / 2), :y => bounds[:height], 'font-size' => [:theme].legend_font_size || relative(100), 'font-family' => [:theme].font_family, :fill => [:theme].marker, :stroke => 'none', 'stroke-width' => '0', 'text-anchor' => (@options[:text_anchor] || 'middle')) end end |