Commit e4cb914b authored by zhangshuo's avatar zhangshuo

更新最新数据+更改访问顺序

parent f0876a65
......@@ -82,7 +82,6 @@ def analysis_goods(load_data, chart):
# 仅一单为常规
if len(user_buy_list) == 1:
count_in_dict(result_dict, '仅1单(常规订单)\n')
print(user_buy_list)
else:
user_buy_detail_s = user_buy_list[1]
if load_data.is_zero_buy(user_buy_detail_s) <= 1.0:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import pyecharts.options as opts
from pyecharts.charts import Line, Pie, Page
# 相关的配置地址:https://pyecharts.org/#/zh-cn/intro
# 用于封装 pyecharts 相关的方法
......@@ -11,10 +12,14 @@ class EChartDraw(object):
# 绘制饼状图
def draw_pie_chart(self, title_name, data_dict):
x_data = sorted(data_dict)
data_dict_sorted = sorted(data_dict.items(), key=lambda kv: (kv[1], kv[0]))
x_data = []
y_data = []
for key in x_data:
y_data.append(data_dict[key])
for key, value in data_dict_sorted:
x_data.append(key)
y_data.append(value)
x_data.reverse()
y_data.reverse()
pie = Pie(init_opts=opts.InitOpts(width="1200px", height="600px"))
pie.set_global_opts(title_opts=opts.TitleOpts(title=title_name), legend_opts=opts.LegendOpts(pos_top=50),
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment