From 722bd06a6999647f982fdff9dbdc0b9f107a9b92 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 16:54:03 +0800 Subject: [PATCH] . --- chapter2/mysite/myapp/static/scripts/trend.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chapter2/mysite/myapp/static/scripts/trend.js b/chapter2/mysite/myapp/static/scripts/trend.js index 4145c0f..7146163 100755 --- a/chapter2/mysite/myapp/static/scripts/trend.js +++ b/chapter2/mysite/myapp/static/scripts/trend.js @@ -12,7 +12,8 @@ $(function(){ var myColor = ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6']; - var histogramChart1 = echarts.init(document.getElementById('histogramChart1')); + if(document.getElementById('histogramChart1')){ + var histogramChart1 = echarts.init(document.getElementById('histogramChart1')); if(histogramChart1){ histogramChart1.setOption({ @@ -77,6 +78,8 @@ $(function(){ ] }) } + } + //主要症状 @@ -143,7 +146,8 @@ $(function(){ }) //传染病发病趋势 - var lineChart1 = echarts.init(document.getElementById('lineChart1')); + if (document.getElementById('lineChart1')) { + var lineChart1 = echarts.init(document.getElementById('lineChart1')); if(lineChart1){ lineChart1.setOption({ title: { @@ -224,6 +228,8 @@ $(function(){ }) } + } + //TOP10销量趋势