plots
main.plots
¤
Plots for displaying database data.
Functions¤
create_bar_plot(title, months, values)
¤
Creates a bar plot with dates versus values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
plot title |
required |
months
|
list[str]
|
a list of months to display on the x-axis |
required |
values
|
list[float]
|
a list of total charge values for the bar height indicate on the y-axis |
required |
Returns:
Type | Description |
---|---|
figure
|
Bokeh figure for the bar chart. |
Source code in main/plots.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
create_capacity_planning_plot(start_date, end_date)
¤
Generates all the time series data and creates the capacity planning plot.
Includes all business days between the selected start and end date, inclusive of the start date. Time for the effort (aggregated over all projects) and capacity (aggregated over all users) are calculated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_date
|
datetime
|
datetime object representing the start of the plotting period |
required |
end_date
|
datetime
|
datetime object representing the end of the plotting period |
required |
Returns:
Type | Description |
---|---|
figure
|
Bokeh figure containing timeseries data. |
Source code in main/plots.py
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 |
|
create_cost_recovery_plots()
¤
Creates the cost recovery plot for the last year.
Provides an overview of team capacity over the past year and the project charging.
Returns:
Type | Description |
---|---|
tuple[figure, figure]
|
Tuple of Bokeh figures containing cost recovery data timeseries data and monthly charges for the past year. |
Source code in main/plots.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
create_timeseries_plot(title, traces)
¤
Creates a generic timeseries plot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
plot title |
required |
traces
|
list[dict[str, Any]]
|
a list of dictionaries with keys for the 'timeseries' data, 'label' and 'colour' |
required |
Returns:
Type | Description |
---|---|
figure
|
Bokeh figure containing timeseries data. |
Source code in main/plots.py
48 49 50 51 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 |
|
html_components_from_plot(plot, prefix=None)
¤
Generate HTML components from a Bokeh plot that can be added to the context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot
|
figure
|
Bokeh figure to be added to the context |
required |
prefix
|
str | None
|
optional prefix to use in the context keys |
None
|
Source code in main/plots.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|