ajout ca groupe global

This commit is contained in:
cthienan
2021-07-28 16:59:08 +02:00
parent d47e2a2378
commit 2917fd4159
4 changed files with 88 additions and 1 deletions

View File

@@ -218,6 +218,32 @@ def ca_groupes(request):
d3 = (item.groupe, float(item.Annee3), tooltip_y3)
chart_ca_3y_3.append(d3)
# lire les CA par mois
items = get_ca_groupe_3y_with_others(request, societe, thisyear)
chart_ca_3y_1_x = []
chart_ca_3y_2_x = []
chart_ca_3y_3_x = []
# titre des colonnes
chart_ca_3y_1_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
chart_ca_3y_2_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
chart_ca_3y_3_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
title1 = 'CA ' + str(thisyear - 2)
title2 = 'CA ' + str(thisyear - 1)
title3 = 'CA ' + str(thisyear)
for item in items:
# construire la liste pour donut cible
tooltip_y1 = item.groupe + ' \nCA: '+str(item.Annee1) + '\nDossiers: '+str(round(item.Count1))
tooltip_y2 = item.groupe + ' \nCA: '+str(item.Annee2) + '\nDossiers: '+str(round(item.Count1))
tooltip_y3 = item.groupe + ' \nCA: '+str(item.Annee3) + '\nDossiers: '+str(round(item.Count1))
# ('+str(item.population)+')/n'
d1_x = (item.groupe, float(item.Annee1), tooltip_y1)
chart_ca_3y_1_x.append(d1_x)
d2_x = (item.groupe, float(item.Annee2), tooltip_y2)
chart_ca_3y_2_x.append(d2_x)
d3_x = (item.groupe, float(item.Annee3), tooltip_y3)
chart_ca_3y_3_x.append(d3_x)
return {
'page_title': "CA par groupe",
'url': url,
@@ -225,6 +251,9 @@ def ca_groupes(request):
'chart_ca_3y_1': json.dumps(chart_ca_3y_1),
'chart_ca_3y_2': json.dumps(chart_ca_3y_2),
'chart_ca_3y_3': json.dumps(chart_ca_3y_3),
'chart_ca_3y_1_x': json.dumps(chart_ca_3y_1_x),
'chart_ca_3y_2_x': json.dumps(chart_ca_3y_2_x),
'chart_ca_3y_3_x': json.dumps(chart_ca_3y_3_x),
'title': title,
'title1': title1,
'title2': title2,