提交 d30c0615 编写于 作者: X xinwen

[Fix] index api

上级 a5827075
...@@ -11,8 +11,6 @@ from collections import Counter ...@@ -11,8 +11,6 @@ from collections import Counter
from pyecharts.charts import Line from pyecharts.charts import Line
from pyecharts import options as opts from pyecharts import options as opts
from pyecharts.charts import Bar, Page from pyecharts.charts import Bar, Page
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshot
from users.models import User from users.models import User
from assets.models import Asset from assets.models import Asset
...@@ -357,7 +355,7 @@ class ExportIndexApi(TotalCountMixin, WeekSessionMetricMixin, MonthLoginMetricMi ...@@ -357,7 +355,7 @@ class ExportIndexApi(TotalCountMixin, WeekSessionMetricMixin, MonthLoginMetricMi
) )
week_login_times_top10_users = self.get_week_login_times_top10_users() week_login_times_top10_users = self.get_week_login_times_top10_users()
x, y = zip(*[(item['user'], item['total']) for item in week_login_times_top10_users]) x, y = list(zip(*[(item['user'], item['total']) for item in week_login_times_top10_users])) or [[], []]
c3 = ( c3 = (
Bar() Bar()
.add_xaxis(x) .add_xaxis(x)
...@@ -369,7 +367,7 @@ class ExportIndexApi(TotalCountMixin, WeekSessionMetricMixin, MonthLoginMetricMi ...@@ -369,7 +367,7 @@ class ExportIndexApi(TotalCountMixin, WeekSessionMetricMixin, MonthLoginMetricMi
) )
week_login_times_top10_assets = self.get_week_login_times_top10_assets() week_login_times_top10_assets = self.get_week_login_times_top10_assets()
x, y = zip(*[(item['asset'], item['total']) for item in week_login_times_top10_assets]) x, y = list(zip(*[(item['asset'], item['total']) for item in week_login_times_top10_assets])) or [[], []]
c4 = ( c4 = (
Bar() Bar()
.add_xaxis(x) .add_xaxis(x)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册