mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
analytics: Add backend for messages read over time graph.
This commit includes changes in the api /json/analytics/chart_data to send data for the newly added graph, as well as tests.
This commit is contained in:
@@ -236,6 +236,12 @@ def get_chart_data(request: HttpRequest, user_profile: UserProfile, chart_name:
|
||||
{str(id): name for id, name in Client.objects.values_list('id', 'name')}}
|
||||
labels_sort_function = sort_client_labels
|
||||
include_empty_subgroups = False
|
||||
elif chart_name == 'messages_read_over_time':
|
||||
stats = [COUNT_STATS['messages_read::hour']]
|
||||
tables = [aggregate_table, UserCount]
|
||||
subgroup_to_label = {stats[0]: {None: 'read'}}
|
||||
labels_sort_function = None
|
||||
include_empty_subgroups = True
|
||||
else:
|
||||
raise JsonableError(_("Unknown chart name: %s") % (chart_name,))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user