Class: ActiveCharts::RectangularChart
- Defined in:
- lib/active_charts/rectangular_chart.rb
Constant Summary collapse
- TOP_LEFT_OFFSET =
1
Constants inherited from Chart
Chart::CSS_CLASSES, Chart::MARGIN
Instance Attribute Summary collapse
-
#grid_height ⇒ Object
readonly
Returns the value of attribute grid_height.
-
#grid_width ⇒ Object
readonly
Returns the value of attribute grid_width.
-
#svg_height ⇒ Object
readonly
Returns the value of attribute svg_height.
-
#svg_width ⇒ Object
readonly
Returns the value of attribute svg_width.
Attributes inherited from Chart
#collection, #columns_count, #data_formatters, #extra_css_classes, #label_height, #max_values, #rows_count, #series_labels, #title
Instance Method Summary collapse
- #grid_rect_tag ⇒ Object
-
#initialize(collection, options = {}) ⇒ RectangularChart
constructor
A new instance of RectangularChart.
Methods inherited from Chart
#chart_svg_tag, #legend_list_tag, #to_html
Constructor Details
#initialize(collection, options = {}) ⇒ RectangularChart
Returns a new instance of RectangularChart.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/active_charts/rectangular_chart.rb', line 5 def initialize(collection, = {}) super prereq_calcs values = values_calcs width_calcs(values.map(&width_filter)) height_calcs(values.map(&height_filter)) end |
Instance Attribute Details
#grid_height ⇒ Object (readonly)
Returns the value of attribute grid_height.
16 17 18 |
# File 'lib/active_charts/rectangular_chart.rb', line 16 def grid_height @grid_height end |
#grid_width ⇒ Object (readonly)
Returns the value of attribute grid_width.
16 17 18 |
# File 'lib/active_charts/rectangular_chart.rb', line 16 def grid_width @grid_width end |
#svg_height ⇒ Object (readonly)
Returns the value of attribute svg_height.
16 17 18 |
# File 'lib/active_charts/rectangular_chart.rb', line 16 def svg_height @svg_height end |
#svg_width ⇒ Object (readonly)
Returns the value of attribute svg_width.
16 17 18 |
# File 'lib/active_charts/rectangular_chart.rb', line 16 def svg_width @svg_width end |
Instance Method Details
#grid_rect_tag ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/active_charts/rectangular_chart.rb', line 18 def grid_rect_tag tag.rect( x: TOP_LEFT_OFFSET, y: TOP_LEFT_OFFSET, height: grid_height - TOP_LEFT_OFFSET * 2, width: grid_width - TOP_LEFT_OFFSET * 2, class: 'grid' ) end |