1
This commit is contained in:
parent
5f38bd20a1
commit
26f63b6f68
@ -720,6 +720,10 @@ async def scatter_model(
|
||||
analysis = res['analysis']
|
||||
groupby = res['groupby']
|
||||
quota_interval_arr = res['quota_interval_arr']
|
||||
# 兼容合计的
|
||||
if res['time_particle'] == 'total':
|
||||
df['date'] = '合计'
|
||||
|
||||
if analysis != 'number_of_days' and interval_type != 'discrete':
|
||||
max_v = int(df['values'].max())
|
||||
min_v = int(df['values'].min())
|
||||
@ -740,9 +744,7 @@ async def scatter_model(
|
||||
for i, v in enumerate(quota_interval_arr[1:]):
|
||||
resp['label'].append(f'[{quota_interval_arr[i]},{v})')
|
||||
bins.append(v)
|
||||
# 合计的
|
||||
if res['time_particle'] == 'total':
|
||||
df['date'] = '合计'
|
||||
|
||||
|
||||
# 这是整体的
|
||||
for key, tmp_df in df.groupby('date'):
|
||||
@ -783,12 +785,14 @@ async def scatter_model(
|
||||
'end_date': res['end_date'],
|
||||
'time_particle': res['time_particle']
|
||||
}
|
||||
total_dict = {}
|
||||
labels = [str(i) for i in sorted(df['values'].unique())]
|
||||
resp['label'] = labels
|
||||
for key, tmp_df in df.groupby(['date']):
|
||||
total = len(tmp_df)
|
||||
dt = key.strftime('%Y-%m-%d')
|
||||
if res['time_particle'] == 'total':
|
||||
dt='合计'
|
||||
else:
|
||||
dt = key.strftime('%Y-%m-%d')
|
||||
labels_dict = {}
|
||||
for key2, tmp_df2 in tmp_df.groupby('values'):
|
||||
label = str(key2)
|
||||
|
Loading…
Reference in New Issue
Block a user