From 94ecc88bd6f912e177e2664f90a71f93a0e63abe Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 16:32:22 +0800 Subject: [PATCH] . --- chapter2/mysite/myapp/static/scripts/trend.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/chapter2/mysite/myapp/static/scripts/trend.js b/chapter2/mysite/myapp/static/scripts/trend.js index 88893e8..f0de9ea 100755 --- a/chapter2/mysite/myapp/static/scripts/trend.js +++ b/chapter2/mysite/myapp/static/scripts/trend.js @@ -221,6 +221,14 @@ $(function(){ }) //TOP10销量趋势 + var histogramChart3_names = []; + var histogramChart3_datas =[]; + for(var key in top10_sells){ + histogramChart3_names.push(key['product_name']); + histogramChart3_datas.push(key['good_c']); + } + + var histogramChart3 = echarts.init(document.getElementById('histogramChart3')); histogramChart3.setOption({ @@ -233,7 +241,7 @@ $(function(){ }, yAxis: [{ show: true, - data: ['女装','鞋靴','童装玩具','手机','美妆 ','珠宝','保健品','眼镜'], + data: histogramChart3_names, inverse: true, axisLine: { show: false @@ -269,7 +277,7 @@ $(function(){ }, { show: true, inverse: true, - data: [2000, 1800, 1200, 1100,900,900,800,700], + data: histogramChart3_datas, axisLabel: { textStyle: { fontSize: 12,