Class: Quby::Questionnaires::DSL::LineChartBuilder
- Inherits:
-
ChartBuilder
- Object
- ChartBuilder
- Quby::Questionnaires::DSL::LineChartBuilder
show all
- Defined in:
- lib/quby/questionnaires/dsl/charting/line_chart_builder.rb
Instance Method Summary
collapse
#build, chart_class, #chart_type, #initialize, #plot, #range, set_chart_class, #tick_interval, #title, #y_categories, #y_range_categories
Instance Method Details
#baseline(value = nil, &block) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/quby/questionnaires/dsl/charting/line_chart_builder.rb', line 20
def baseline(value = nil, &block)
unless value.nil? ^ block.nil?
fail ArgumentError, "Must give either value or a block"
end
if value
@chart.baseline = ->(age, gender) { value }
end
if block
if block.arity != 2
fail ArgumentError, "Given block must take two arguments"
end
@chart.baseline = block
end
end
|
#clinically_relevant_change(value) ⇒ Object
37
38
39
|
# File 'lib/quby/questionnaires/dsl/charting/line_chart_builder.rb', line 37
def clinically_relevant_change(value)
@chart.clinically_relevant_change = value
end
|
#tonality(value) ⇒ Object
16
17
18
|
# File 'lib/quby/questionnaires/dsl/charting/line_chart_builder.rb', line 16
def tonality(value)
@chart.tonality = value
end
|
#validate! ⇒ Object
41
42
43
|
# File 'lib/quby/questionnaires/dsl/charting/line_chart_builder.rb', line 41
def validate!
fail "Chart #{@chart.key} has no range specified" unless @chart.y_range
end
|
#y_axis_label(label) ⇒ Object
12
13
14
|
# File 'lib/quby/questionnaires/dsl/charting/line_chart_builder.rb', line 12
def y_axis_label(label)
@chart.y_label = label
end
|