Class: RubyvisCharts::AbstractTimelineChart
- Inherits:
-
AbstractChart
- Object
- AbstractChart
- RubyvisCharts::AbstractTimelineChart
- Defined in:
- lib/rubyvis_charts/abstract_timeline_chart.rb
Direct Known Subclasses
AreaTimelineChart, BarTimelineChart, GroupedBarTimelineChart, LineTimelineChart, StackedBarTimelineChart
Defined Under Namespace
Modules: DefaultArguments
Constant Summary collapse
- EXTRA_WEEKEND_BARS_WIDTH =
0.2
- TITLE_TOP_INDENT =
-15
Instance Attribute Summary collapse
-
#custom_legend_offset ⇒ Object
readonly
Returns the value of attribute custom_legend_offset.
-
#dates ⇒ Object
readonly
Returns the value of attribute dates.
-
#dates_color ⇒ Object
readonly
Returns the value of attribute dates_color.
-
#dates_font ⇒ Object
readonly
Returns the value of attribute dates_font.
-
#dates_formatter ⇒ Object
readonly
Returns the value of attribute dates_formatter.
-
#dates_height_ratio ⇒ Object
readonly
Returns the value of attribute dates_height_ratio.
-
#layer_dates ⇒ Object
readonly
Returns the value of attribute layer_dates.
-
#layer_legend ⇒ Object
readonly
Returns the value of attribute layer_legend.
-
#layer_marks ⇒ Object
readonly
Returns the value of attribute layer_marks.
-
#layer_numbers ⇒ Object
readonly
Returns the value of attribute layer_numbers.
-
#layer_timeline ⇒ Object
readonly
Returns the value of attribute layer_timeline.
-
#layer_title ⇒ Object
readonly
Returns the value of attribute layer_title.
-
#legend_chars ⇒ Object
readonly
Returns the value of attribute legend_chars.
-
#legend_colors ⇒ Object
readonly
Returns the value of attribute legend_colors.
-
#legend_font ⇒ Object
readonly
Returns the value of attribute legend_font.
-
#legend_shape ⇒ Object
readonly
Returns the value of attribute legend_shape.
-
#legend_text_color ⇒ Object
readonly
Returns the value of attribute legend_text_color.
-
#legend_titles ⇒ Object
readonly
Returns the value of attribute legend_titles.
-
#marks ⇒ Object
readonly
Returns the value of attribute marks.
-
#marks_color ⇒ Object
readonly
Returns the value of attribute marks_color.
-
#marks_font ⇒ Object
readonly
Returns the value of attribute marks_font.
-
#marks_formatter ⇒ Object
readonly
Returns the value of attribute marks_formatter.
-
#marks_height_ratio ⇒ Object
readonly
Returns the value of attribute marks_height_ratio.
-
#numbers_color ⇒ Object
readonly
Returns the value of attribute numbers_color.
-
#numbers_font ⇒ Object
readonly
Returns the value of attribute numbers_font.
-
#numbers_formatter ⇒ Object
readonly
Returns the value of attribute numbers_formatter.
-
#rules_color ⇒ Object
readonly
Returns the value of attribute rules_color.
-
#rules_count ⇒ Object
readonly
Returns the value of attribute rules_count.
-
#threshold_caption ⇒ Object
readonly
Returns the value of attribute threshold_caption.
-
#threshold_color ⇒ Object
readonly
Returns the value of attribute threshold_color.
-
#threshold_number ⇒ Object
readonly
Returns the value of attribute threshold_number.
-
#threshold_width ⇒ Object
readonly
Returns the value of attribute threshold_width.
-
#timeline_width_ratio ⇒ Object
readonly
Returns the value of attribute timeline_width_ratio.
-
#title_color ⇒ Object
readonly
Returns the value of attribute title_color.
-
#title_font ⇒ Object
readonly
Returns the value of attribute title_font.
-
#title_text ⇒ Object
readonly
Returns the value of attribute title_text.
-
#weekend_bar_color ⇒ Object
readonly
Returns the value of attribute weekend_bar_color.
-
#y_scale_max ⇒ Object
readonly
Returns the value of attribute y_scale_max.
Attributes inherited from AbstractChart
#height, #inner_box_height, #inner_box_width, #padding, #parent_layer, #values, #width
Instance Method Summary collapse
- #dates_height ⇒ Object
- #dates_width ⇒ Object
-
#initialize(dates:, marks: DefaultArguments::MARKS, y_scale_max: DefaultArguments::Y_SCALE_MAX, numbers_formatter: DefaultArguments::NUMBERS_FORMATTER, numbers_color: DefaultArguments::NUMBERS_COLOR, numbers_font: DefaultArguments::NUMBERS_FONT, title_text: DefaultArguments::TITLE_TEXT, title_color: DefaultArguments::TITLE_COLOR, title_font: DefaultArguments::TITLE_FONT, dates_formatter: DefaultArguments::DATES_FORMATTER, dates_color: DefaultArguments::DATES_COLOR, dates_font: DefaultArguments::DATES_FONT, marks_color: DefaultArguments::MARKS_COLOR, marks_font: DefaultArguments::MARKS_FONT, marks_formatter: DefaultArguments::MARKS_FORMATTER, rules_color: DefaultArguments::RULES_COLOR, rules_count: DefaultArguments::RULES_COUNT, weekend_bar_color: DefaultArguments::WEEKEND_BAR_COLOR, timeline_width_ratio: DefaultArguments::TIMELINE_WIDTH_RATIO, dates_height_ratio: DefaultArguments::DATES_HEIGHT_RATIO, marks_height_ratio: DefaultArguments::MARKS_HEIGHT_RATIO, legend_titles: DefaultArguments::LEGEND_TITLES, legend_colors: DefaultArguments::LEGEND_COLORS, legend_text_color: DefaultArguments::LEGEND_TEXT_COLOR, legend_font: DefaultArguments::LEGEND_FONT, legend_shape: DefaultArguments::LEGEND_SHAPE, legend_chars: DefaultArguments::LEGEND_CHARS, custom_legend_offset: nil, threshold_number: DefaultArguments::THRESHOLD_NUMBER, threshold_color: DefaultArguments::THRESHOLD_COLOR, threshold_width: DefaultArguments::THRESHOLD_WIDTH, threshold_caption: DefaultArguments::THRESHOLD_CAPTION, **other) ⇒ AbstractTimelineChart
constructor
A new instance of AbstractTimelineChart.
- #legend_height ⇒ Object
- #legend_width ⇒ Object
- #marks_height ⇒ Object
- #marks_width ⇒ Object
- #numbers_height ⇒ Object
- #numbers_width ⇒ Object
- #timeline_height ⇒ Object
- #timeline_width ⇒ Object
- #title_height ⇒ Object
- #title_width ⇒ Object
Methods inherited from AbstractChart
Constructor Details
#initialize(dates:, marks: DefaultArguments::MARKS, y_scale_max: DefaultArguments::Y_SCALE_MAX, numbers_formatter: DefaultArguments::NUMBERS_FORMATTER, numbers_color: DefaultArguments::NUMBERS_COLOR, numbers_font: DefaultArguments::NUMBERS_FONT, title_text: DefaultArguments::TITLE_TEXT, title_color: DefaultArguments::TITLE_COLOR, title_font: DefaultArguments::TITLE_FONT, dates_formatter: DefaultArguments::DATES_FORMATTER, dates_color: DefaultArguments::DATES_COLOR, dates_font: DefaultArguments::DATES_FONT, marks_color: DefaultArguments::MARKS_COLOR, marks_font: DefaultArguments::MARKS_FONT, marks_formatter: DefaultArguments::MARKS_FORMATTER, rules_color: DefaultArguments::RULES_COLOR, rules_count: DefaultArguments::RULES_COUNT, weekend_bar_color: DefaultArguments::WEEKEND_BAR_COLOR, timeline_width_ratio: DefaultArguments::TIMELINE_WIDTH_RATIO, dates_height_ratio: DefaultArguments::DATES_HEIGHT_RATIO, marks_height_ratio: DefaultArguments::MARKS_HEIGHT_RATIO, legend_titles: DefaultArguments::LEGEND_TITLES, legend_colors: DefaultArguments::LEGEND_COLORS, legend_text_color: DefaultArguments::LEGEND_TEXT_COLOR, legend_font: DefaultArguments::LEGEND_FONT, legend_shape: DefaultArguments::LEGEND_SHAPE, legend_chars: DefaultArguments::LEGEND_CHARS, custom_legend_offset: nil, threshold_number: DefaultArguments::THRESHOLD_NUMBER, threshold_color: DefaultArguments::THRESHOLD_COLOR, threshold_width: DefaultArguments::THRESHOLD_WIDTH, threshold_caption: DefaultArguments::THRESHOLD_CAPTION, **other) ⇒ AbstractTimelineChart
Returns a new instance of AbstractTimelineChart.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 52 def initialize( dates:, marks: DefaultArguments::MARKS, y_scale_max: DefaultArguments::Y_SCALE_MAX, numbers_formatter: DefaultArguments::NUMBERS_FORMATTER, numbers_color: DefaultArguments::NUMBERS_COLOR, numbers_font: DefaultArguments::NUMBERS_FONT, title_text: DefaultArguments::TITLE_TEXT, title_color: DefaultArguments::TITLE_COLOR, title_font: DefaultArguments::TITLE_FONT, dates_formatter: DefaultArguments::DATES_FORMATTER, dates_color: DefaultArguments::DATES_COLOR, dates_font: DefaultArguments::DATES_FONT, marks_color: DefaultArguments::MARKS_COLOR, marks_font: DefaultArguments::MARKS_FONT, marks_formatter: DefaultArguments::MARKS_FORMATTER, rules_color: DefaultArguments::RULES_COLOR, rules_count: DefaultArguments::RULES_COUNT, weekend_bar_color: DefaultArguments::WEEKEND_BAR_COLOR, timeline_width_ratio: DefaultArguments::TIMELINE_WIDTH_RATIO, dates_height_ratio: DefaultArguments::DATES_HEIGHT_RATIO, marks_height_ratio: DefaultArguments::MARKS_HEIGHT_RATIO, legend_titles: DefaultArguments::LEGEND_TITLES, legend_colors: DefaultArguments::LEGEND_COLORS, legend_text_color: DefaultArguments::LEGEND_TEXT_COLOR, legend_font: DefaultArguments::LEGEND_FONT, legend_shape: DefaultArguments::LEGEND_SHAPE, legend_chars: DefaultArguments::LEGEND_CHARS, custom_legend_offset: nil, threshold_number: DefaultArguments::THRESHOLD_NUMBER, threshold_color: DefaultArguments::THRESHOLD_COLOR, threshold_width: DefaultArguments::THRESHOLD_WIDTH, threshold_caption: DefaultArguments::THRESHOLD_CAPTION, **other ) super(other) @dates = dates @marks = marks @y_scale_max = y_scale_max @numbers_formatter = numbers_formatter @numbers_color = numbers_color @numbers_font = numbers_font @title_text = title_text @title_color = title_color @title_font = title_font @dates_formatter = dates_formatter @dates_color = dates_color @marks_color = marks_color @marks_formatter = marks_formatter @marks_font = marks_font @rules_color = rules_color @rules_count = rules_count @weekend_bar_color = @timeline_width_ratio = timeline_width_ratio @dates_height_ratio = dates_height_ratio @marks_height_ratio = marks_height_ratio @legend_titles = legend_titles @legend_colors = legend_colors @legend_text_color = legend_text_color @legend_font = legend_font @legend_shape = legend_shape @legend_chars = legend_chars @dates_font = dates_font @custom_legend_offset = custom_legend_offset @threshold_number = threshold_number @threshold_color = threshold_color @threshold_width = threshold_width @threshold_caption = initialize_layers! initialize_numbers! initialize_rules! initialize_title! initialize_dates! initialize_marks! initialize_threshold! initialize_legend! end |
Instance Attribute Details
#custom_legend_offset ⇒ Object (readonly)
Returns the value of attribute custom_legend_offset.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def custom_legend_offset @custom_legend_offset end |
#dates ⇒ Object (readonly)
Returns the value of attribute dates.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def dates @dates end |
#dates_color ⇒ Object (readonly)
Returns the value of attribute dates_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def dates_color @dates_color end |
#dates_font ⇒ Object (readonly)
Returns the value of attribute dates_font.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def dates_font @dates_font end |
#dates_formatter ⇒ Object (readonly)
Returns the value of attribute dates_formatter.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def dates_formatter @dates_formatter end |
#dates_height_ratio ⇒ Object (readonly)
Returns the value of attribute dates_height_ratio.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def dates_height_ratio @dates_height_ratio end |
#layer_dates ⇒ Object (readonly)
Returns the value of attribute layer_dates.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_dates @layer_dates end |
#layer_legend ⇒ Object (readonly)
Returns the value of attribute layer_legend.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_legend @layer_legend end |
#layer_marks ⇒ Object (readonly)
Returns the value of attribute layer_marks.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_marks @layer_marks end |
#layer_numbers ⇒ Object (readonly)
Returns the value of attribute layer_numbers.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_numbers @layer_numbers end |
#layer_timeline ⇒ Object (readonly)
Returns the value of attribute layer_timeline.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_timeline @layer_timeline end |
#layer_title ⇒ Object (readonly)
Returns the value of attribute layer_title.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def layer_title @layer_title end |
#legend_chars ⇒ Object (readonly)
Returns the value of attribute legend_chars.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_chars @legend_chars end |
#legend_colors ⇒ Object (readonly)
Returns the value of attribute legend_colors.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_colors @legend_colors end |
#legend_font ⇒ Object (readonly)
Returns the value of attribute legend_font.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_font @legend_font end |
#legend_shape ⇒ Object (readonly)
Returns the value of attribute legend_shape.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_shape @legend_shape end |
#legend_text_color ⇒ Object (readonly)
Returns the value of attribute legend_text_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_text_color @legend_text_color end |
#legend_titles ⇒ Object (readonly)
Returns the value of attribute legend_titles.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def legend_titles @legend_titles end |
#marks ⇒ Object (readonly)
Returns the value of attribute marks.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def marks @marks end |
#marks_color ⇒ Object (readonly)
Returns the value of attribute marks_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def marks_color @marks_color end |
#marks_font ⇒ Object (readonly)
Returns the value of attribute marks_font.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def marks_font @marks_font end |
#marks_formatter ⇒ Object (readonly)
Returns the value of attribute marks_formatter.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def marks_formatter @marks_formatter end |
#marks_height_ratio ⇒ Object (readonly)
Returns the value of attribute marks_height_ratio.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def marks_height_ratio @marks_height_ratio end |
#numbers_color ⇒ Object (readonly)
Returns the value of attribute numbers_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def numbers_color @numbers_color end |
#numbers_font ⇒ Object (readonly)
Returns the value of attribute numbers_font.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def numbers_font @numbers_font end |
#numbers_formatter ⇒ Object (readonly)
Returns the value of attribute numbers_formatter.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def numbers_formatter @numbers_formatter end |
#rules_color ⇒ Object (readonly)
Returns the value of attribute rules_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def rules_color @rules_color end |
#rules_count ⇒ Object (readonly)
Returns the value of attribute rules_count.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def rules_count @rules_count end |
#threshold_caption ⇒ Object (readonly)
Returns the value of attribute threshold_caption.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def @threshold_caption end |
#threshold_color ⇒ Object (readonly)
Returns the value of attribute threshold_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def threshold_color @threshold_color end |
#threshold_number ⇒ Object (readonly)
Returns the value of attribute threshold_number.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def threshold_number @threshold_number end |
#threshold_width ⇒ Object (readonly)
Returns the value of attribute threshold_width.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def threshold_width @threshold_width end |
#timeline_width_ratio ⇒ Object (readonly)
Returns the value of attribute timeline_width_ratio.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def timeline_width_ratio @timeline_width_ratio end |
#title_color ⇒ Object (readonly)
Returns the value of attribute title_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def title_color @title_color end |
#title_font ⇒ Object (readonly)
Returns the value of attribute title_font.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def title_font @title_font end |
#title_text ⇒ Object (readonly)
Returns the value of attribute title_text.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def title_text @title_text end |
#weekend_bar_color ⇒ Object (readonly)
Returns the value of attribute weekend_bar_color.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def @weekend_bar_color end |
#y_scale_max ⇒ Object (readonly)
Returns the value of attribute y_scale_max.
39 40 41 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 39 def y_scale_max @y_scale_max end |
Instance Method Details
#dates_height ⇒ Object
154 155 156 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 154 def dates_height inner_box_height * dates_height_ratio end |
#dates_width ⇒ Object
150 151 152 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 150 def dates_width timeline_width end |
#legend_height ⇒ Object
178 179 180 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 178 def legend_height legend_titles.any? ? dates_height : 0 end |
#legend_width ⇒ Object
174 175 176 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 174 def legend_width timeline_width end |
#marks_height ⇒ Object
158 159 160 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 158 def marks_height inner_box_height * marks_height_ratio end |
#marks_width ⇒ Object
162 163 164 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 162 def marks_width timeline_width end |
#numbers_height ⇒ Object
138 139 140 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 138 def numbers_height timeline_height end |
#numbers_width ⇒ Object
134 135 136 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 134 def numbers_width inner_box_width - timeline_width end |
#timeline_height ⇒ Object
170 171 172 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 170 def timeline_height inner_box_height - dates_height - legend_height - marks_height end |
#timeline_width ⇒ Object
166 167 168 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 166 def timeline_width inner_box_width * timeline_width_ratio end |
#title_height ⇒ Object
146 147 148 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 146 def title_height dates_height end |
#title_width ⇒ Object
142 143 144 |
# File 'lib/rubyvis_charts/abstract_timeline_chart.rb', line 142 def title_width numbers_width end |