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销量趋势