From c6a5fd4aa8e5f69d07a51301766e8e721b5f914d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 17:00:34 +0800 Subject: [PATCH] . --- chapter2/mysite/myapp/static/scripts/trend.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chapter2/mysite/myapp/static/scripts/trend.js b/chapter2/mysite/myapp/static/scripts/trend.js index 3382801..55c61d5 100755 --- a/chapter2/mysite/myapp/static/scripts/trend.js +++ b/chapter2/mysite/myapp/static/scripts/trend.js @@ -237,12 +237,12 @@ $(function(){ var histogramChart3_datas =[]; var histogramChart3_rates =[]; for(var key in top10_sells){ - var base = top10_sells[0]; - var data = top10_sells[key]; - histogramChart3_names.push(data['product_name'].substring(0,10)); - histogramChart3_datas.push(data['good_c']); - var rate = data['good_c'] * 100 / base['good_c']; - histogramChart3_rates.push(rate.toFixed(0)); + var base = top10_sells[0]; + var data = top10_sells[key]; + histogramChart3_names.push(data['product_name'].substring(0,20)); + histogramChart3_datas.push(data['good_c']); + var rate = data['good_c'] * 100 / base['good_c']; + histogramChart3_rates.push(rate.toFixed(0)); }