Class: CycletimeScatterplot

Inherits:
TimeBasedScatterplot show all
Defined in:
lib/jirametrics/cycletime_scatterplot.rb

Constant Summary

Constants inherited from ChartBase

ChartBase::LABEL_POSITIONS

Instance Attribute Summary collapse

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

Methods inherited from TimeBasedScatterplot

#calculate_percent_line, #create_datasets, #data_for_item, #run, #show_trend_lines, #trend_line_data_set

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) ⇒ CycletimeScatterplot

Returns a new instance of CycletimeScatterplot.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 8

def initialize block
  super()

  header_text 'Cycletime Scatterplot'
  description_text "    <div class=\"p\">\n      This chart shows only completed work and indicates both what day it completed as well as\n      how many days it took to get done. Hovering over a dot will show you the ID of the work item.\n    </div>\n    <div class=\"p\">\n      The \#{color_block '--cycletime-scatterplot-overall-trendline-color'} line indicates the 85th\n      percentile (<%= overall_percent_line %> days). 85% of all\n      items on this chart fall on or below the line and the remaining 15% are above the line. 85%\n      is a reasonable proxy for \"most\" so that we can say that based on this data set, we can\n      predict that most work of this type will complete in <%= overall_percent_line %> days or\n      less. The other lines reflect the 85% line for that respective type of work.\n    </div>\n    \#{describe_non_working_days}\n  HTML\n  @x_axis_title = 'Date completed'\n  @y_axis_title = 'Cycletime in days'\n\n  init_configuration_block block do\n    grouping_rules do |issue, rule|\n      rule.label = issue.type\n      rule.color = color_for type: issue.type\n    end\n  end\nend\n"

Instance Attribute Details

#possible_statusesObject

Returns the value of attribute possible_statuses.



6
7
8
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 6

def possible_statuses
  @possible_statuses
end

Instance Method Details

#all_itemsObject



42
43
44
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 42

def all_items
  completed_issues_in_range include_unstarted: false
end

#minimum_y_valueObject



38
39
40
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 38

def minimum_y_value
  1 # Values under 1 day are data quality problems; they're flagged in the quality report instead
end

#title_value(item, rules: nil) ⇒ Object



54
55
56
57
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 54

def title_value item, rules: nil
  hint = @issue_hints&.fetch(item, nil)
  "#{item.key} : #{item.summary} (#{label_days(y_value(item))})#{" #{hint}" if hint}"
end

#x_value(item) ⇒ Object



46
47
48
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 46

def x_value item
  item.started_stopped_times.last
end

#y_value(item) ⇒ Object



50
51
52
# File 'lib/jirametrics/cycletime_scatterplot.rb', line 50

def y_value item
  item.board.cycletime.cycletime(item)
end