Class: Scruffy::Components::YLegend
- 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
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/scruffy/components/legend.rb', line 22 def draw(svg, bounds, ={}) if [:title] svg.text([:y_legend], :class => 'title', :x => (0), :y => 0, 'font-size' => [:theme].legend_font_size || relative(100), 'font-family' => [:theme].font_family, :transform => "translate(#{bounds[:width] / 2},#{bounds[:height]/2}) rotate(#{-90})", :fill => [:theme].marker, :stroke => 'none', 'stroke-width' => '0', 'text-anchor' => (@options[:text_anchor] || 'middle')) end end |