From f987dfdb04cfe9777730ba8c81570516a854c400 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 17:35:53 +0800 Subject: [PATCH] . --- chapter2/mysite/myapp/static/scripts/trend.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/chapter2/mysite/myapp/static/scripts/trend.js b/chapter2/mysite/myapp/static/scripts/trend.js index f47bc75..2f7018f 100755 --- a/chapter2/mysite/myapp/static/scripts/trend.js +++ b/chapter2/mysite/myapp/static/scripts/trend.js @@ -361,6 +361,16 @@ $(function(){ //疾病发病趋势 var lineChart2 = echarts.init(document.getElementById('lineChart2')); + + var lineChart2 = echarts.init(document.getElementById('lineChart1')); + var lineChart2_names = []; + var lineChart2_datas = []; + for(var key in last_month_sell){ + lineChart2_names.push(key); + lineChart2_datas.push(last_month_sell[key]); + } + + lineChart2.setOption({ title: { text: '前5月购买趋势', @@ -407,7 +417,7 @@ $(function(){ xAxis: [ { type: 'category', - data : symptomName, + data : lineChart2_names, boundaryGap : false, axisLine:{ lineStyle:{ @@ -435,7 +445,7 @@ $(function(){ type:'line', smooth:true, itemStyle: {normal: {areaStyle: {type: 'default'}}}, - data:[520, 232,701, 434, 190, 230, 210,120, 132, 101, 134, 890] + data:lineChart2_datas, }, ]