Class: CycletimeHistogram
- Inherits:
-
TimeBasedHistogram
- Object
- ChartBase
- TimeBasedHistogram
- CycletimeHistogram
- Defined in:
- lib/jirametrics/cycletime_histogram.rb
Constant Summary
Constants inherited from ChartBase
Instance Attribute Summary collapse
-
#possible_statuses ⇒ Object
Returns the value of attribute possible_statuses.
Attributes inherited from TimeBasedHistogram
Attributes inherited from ChartBase
#aggregated_project, #all_boards, #atlassian_document_format, #board_id, #canvas_height, #canvas_width, #data_quality, #date_range, #file_system, #fix_versions, #holiday_dates, #issues, #settings, #time_range, #timezone_offset, #x_axis_title, #y_axis_title
Instance Method Summary collapse
- #all_items ⇒ Object
-
#initialize(block) ⇒ CycletimeHistogram
constructor
A new instance of CycletimeHistogram.
- #label_for_item(issue, hint:) ⇒ Object
- #sort_items(items) ⇒ Object
- #title_for_item(count:, value:) ⇒ Object
- #value_for_item(issue) ⇒ Object
Methods inherited from TimeBasedHistogram
#data_set_for, #disable_stats, #histogram_data_for, #percentiles, #run, #stats_for
Methods included from GroupableIssueChart
#group_issues, #grouping_rules, #init_configuration_block
Methods inherited from ChartBase
#aggregated_project?, #before_run, #call_before_run, #canvas, #canvas_responsive?, #chart_format, #collapsible_issues_panel, #color_block, #color_for, #completed_issues_in_range, #current_board, #cycletime, #cycletime_for_issue, #daily_chart_dataset, #date_annotation, #describe_non_working_days, #description_text, #format_integer, #format_status, #header_text, #holidays, #html_directory, #icon_span, #label_days, #label_hours, #label_issues, #label_minutes, #link_to_issue, #next_id, #normalize_annotation_datetime, #not_visible_text, #random_color, #render, #render_axis_title, #render_top_text, #seam_end, #seam_start, #stagger_label_positions, #status_category_color, #to_human_readable, #working_days_annotation, #wrap_and_render
Constructor Details
#initialize(block) ⇒ CycletimeHistogram
Returns a new instance of CycletimeHistogram.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 8 def initialize block super() @x_axis_title = 'Cycletime in days' @y_axis_title = 'Count' header_text 'Cycletime Histogram' description_text <<-HTML <p> The Cycletime Histogram shows how many items completed in a certain timeframe. This can be useful for determining how many different types of work are flowing through, based on the lengths of time they take. </p> HTML init_configuration_block(block) do grouping_rules do |issue, rule| rule.label = issue.type rule.color = color_for type: issue.type end end end |
Instance Attribute Details
#possible_statuses ⇒ Object
Returns the value of attribute possible_statuses.
6 7 8 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 6 def possible_statuses @possible_statuses end |
Instance Method Details
#all_items ⇒ Object
31 32 33 34 35 36 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 31 def all_items stopped_issues = completed_issues_in_range include_unstarted: true # For the histogram, we only want to consider items that have both a start and a stop time. stopped_issues.select { |issue| issue.started_stopped_times.first } end |
#label_for_item(issue, hint:) ⇒ Object
50 51 52 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 50 def label_for_item issue, hint: "#{issue.key} : #{issue.summary}#{" #{hint}" if hint}" end |
#sort_items(items) ⇒ Object
46 47 48 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 46 def sort_items items items.sort_by(&:key_as_i) end |
#title_for_item(count:, value:) ⇒ Object
42 43 44 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 42 def title_for_item count:, value: "#{count} items completed in #{label_days value}" end |
#value_for_item(issue) ⇒ Object
38 39 40 |
# File 'lib/jirametrics/cycletime_histogram.rb', line 38 def value_for_item issue issue.board.cycletime.cycletime(issue) end |