mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-05 04:35:46 -07:00
Add hidden-by-default Total curve to the daily stream graph (#2497)
* Add hidden-by-default Total curve to the daily stream graph * Update curve color Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --------- Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
This commit is contained in:
parent
e6c0a12dd5
commit
d2a14ea6c0
2 changed files with 12 additions and 1 deletions
|
@ -301,6 +301,10 @@
|
|||
return obj;
|
||||
}, {});
|
||||
|
||||
if (!("Total" in chart_visibility)) {
|
||||
chart_visibility["Total"] = false;
|
||||
}
|
||||
|
||||
return data_series.map(function(s) {
|
||||
var obj = Object.assign({}, s);
|
||||
obj.visible = (chart_visibility[s.name] !== false);
|
||||
|
@ -327,7 +331,8 @@
|
|||
'Direct Play': '#E5A00D',
|
||||
'Direct Stream': '#FFFFFF',
|
||||
'Transcode': '#F06464',
|
||||
'Max. Concurrent Streams': '#96C83C'
|
||||
'Max. Concurrent Streams': '#96C83C',
|
||||
'Total': '#96C83C'
|
||||
};
|
||||
var series_colors = [];
|
||||
$.each(data_series, function(index, series) {
|
||||
|
|
|
@ -138,6 +138,12 @@ class Graphs(object):
|
|||
if libraries.has_library_type('live'):
|
||||
series_output.append(series_4_output)
|
||||
|
||||
if len(series_output) > 0:
|
||||
series_total = [sum(x) for x in zip(*[x['data'] for x in series_output])]
|
||||
series_total_output = {'name': 'Total',
|
||||
'data': series_total}
|
||||
series_output.append(series_total_output)
|
||||
|
||||
output = {'categories': categories,
|
||||
'series': series_output}
|
||||
return output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue