From 650a12a4302cbcd418d0032af42ddad05b1982dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80=C3=AE=C3=97=C3=9A=C3=95=C3=B1?= Date: Fri, 8 Jul 2022 11:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=88=86=E7=BB=84=E9=A1=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/query.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index f3febbd..c2e431e 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -412,6 +412,17 @@ async def event_model( appgb = str(gb).replace("'", '') groups.append(appgb) item['groups'] = groups + else: + if group_label: + groups = [] + gb = [] + for name, idx in group_label.items(): + gb.insert(idx, name) + # 去掉分组表现里面的'' + appgb = str(gb).replace("'", '') + groups.append(appgb) + item['groups'] = groups + item['values'] = np.array(item['values'])[sort_key].tolist() item['sum'] = np.array(item['sum'])[sort_key].tolist() item['avg'] = np.array(item['avg'])[sort_key].tolist() @@ -1452,7 +1463,8 @@ async def scatter_model( group_by = analysis.event_view['groupBy'] # 排除标签 true_group = [i for i in group_by if i['data_type'] != "user_label"] - columnName = true_group[-1]['columnName'] + # columnName = true_group[-1]['columnName'] + columnName = '' if true_group != []: # if columnName != '': # # 按天分组