Class: Scruffy::Components::ValueMarkers
- Includes:
- Helpers::Marker
- Defined in:
- lib/scruffy/components/value_markers.rb
Instance Attribute Summary collapse
-
#markers ⇒ Object
Returns the value of attribute markers.
Attributes inherited from Base
#id, #options, #position, #size, #visible
Instance Method Summary collapse
Methods included from Helpers::Marker
Methods inherited from Base
#initialize, #process, #render
Constructor Details
This class inherits a constructor from Scruffy::Components::Base
Instance Attribute Details
#markers ⇒ Object
Returns the value of attribute markers.
7 8 9 |
# File 'lib/scruffy/components/value_markers.rb', line 7 def markers @markers end |
Instance Method Details
#draw(svg, bounds, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/scruffy/components/value_markers.rb', line 9 def draw(svg, bounds, ={}) markers = ([:markers] || self.markers) || 5 each_marker(markers, [:min_value], [:max_value], bounds[:height], , :value_formatter) do |label, y| svg.text( label, :x => bounds[:width], :y => (bounds[:height] - y), 'font-size' => [:theme].marker_font_size || relative(8), 'font-family' => [:theme].font_family, :fill => ((.delete(:marker_color_override) || [:theme].marker) || 'white').to_s, 'text-anchor' => 'end') end end |