master
yangxudongll 4 years ago
parent e0dff55fa1
commit 2a58698a6e

@ -9,6 +9,7 @@ def query_province_topn():
db=GetFromDB()
results=db.query_province_topn('2020-08-07',5)
data=jsonify(pub_dates=str(results[0][2]),areas=[x[0] for x in results],curcofirms=[x[1] for x in results])
return data
@app.route("/chinaInfo/",methods=['POST'])
@ -25,7 +26,11 @@ def GlobalInfomation():
db = GetFromDB()
results=db.searchForeignInformation('2020-08-10')
#由于查询到的数据中没有中国的信息,因此需要查询中国的信息加到世界信息中
data=jsonify(country=[x[3] for x in results], confirmed=[x[0] for x in results],died=[x[1] for x in results],
country = [x[3] for x in results]
country.append("中国")
confirmed = [x[0] for x in results]
confirmed.append(db.searchSummaryChina('2020-08-10')[0][1])
data=jsonify(country=country, confirmed=confirmed,died=[x[1] for x in results],
crued=[x[2] for x in results],curConfirm=[x[4] for x in results],confirmedRelative=[x[5] for x in results])
return data

@ -42,6 +42,14 @@ class GetFromDB():
thedate = date + "%"
sql='select confirmed,died,crued,country,curConfirm,confirmedRelative from ForeignCountry where pub_date like "%s"'%(thedate)
self.cursor.execute(sql)
return self.cursor.fetchall()
#查询国内疫情概况
def searchSummaryChina(self,date):
thedate = date + "%"
sql='select * from InsideChina where updateTime like "%s"'%(thedate)
self.cursor.execute(sql)
return self.cursor.fetchall()
return self.cursor.fetchall()

@ -20,7 +20,7 @@
<input class="form-control mr-sm-2" id="topnum" type="search" placeholder="省份个数" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
<div id="main" style="width: 400px;height:400px;">
<div id="main" style="width: 600px;height:400px;">
</div>
</div>
@ -33,27 +33,33 @@
subtitle:'2020-08-10',
left: 'center',
top: 'top'
},
/* tooltip: {
trigger: 'item',
formatter: function (params) {
var value = (params.value + '').split('.');
value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,')
+ '.' + value[1];
return params.seriesName + '<br/>' + params.name + ' : ' + value;
}
},*/
},
tooltip: {
trigger: 'item',
transitionDuration: 0.2,
formatter: function (params) {
var value = params.value;
return "确诊人数:"+value;
}
},
dataRange:{
x:'left',
y:'bottom',
splitList:[
{start:10000000,label:'>1000000',color:'#990000'},
{start:1000000,end:10000000,label:'1000000-1000000',color:'#FF6600'},
{start:100000,end:1000000,label:'100000-1000000',color:'#FF6699'},
{start:10000,end:100000,label:'10000-100000',color:'#FF99CC'},
{start:1000,end:10000,label:'1000-10000',color:'#FFCC00'},
{start:100,end:1000,label:'100-1000',color:'#FFFF00'},
{start:0,end:100,label:'0-100',color:'#FFFFCC'},
],
textStyle:{
color:'#3899FF'
},
selectMode:'false'
},
visualMap: {
min: 0,
max: 11000000,
text:['High','Low'],
realtime: false,
calculable: true,
inRange: {color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
},
},
series: [
{
name: 'World Population (2010)',
@ -278,7 +284,7 @@
}
}
});
myChart.setOption(option);
myChart.setOption(option);
</script>

@ -1,13 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="fcea9d71-f4b2-41ab-b680-ecae8402b966" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/hello.html" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/hello.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GrapData.py" beforeDir="false" afterPath="$PROJECT_DIR$/GrapData.py" afterDir="false" />
</list>
<list default="true" id="fcea9d71-f4b2-41ab-b680-ecae8402b966" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -86,22 +80,22 @@
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state x="704" y="108" width="624" height="753" key="FileChooserDialogImpl/67.27.1853.1053@67.27.1853.1053" timestamp="1596679790740" />
<state width="1814" height="398" key="GridCell.Tab.0.bottom" timestamp="1597041384348">
<state width="1814" height="398" key="GridCell.Tab.0.bottom" timestamp="1597041528193">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597041384348" />
<state width="1814" height="398" key="GridCell.Tab.0.center" timestamp="1597041384344">
<state width="1814" height="398" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597041528193" />
<state width="1814" height="398" key="GridCell.Tab.0.center" timestamp="1597041528191">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597041384344" />
<state width="1814" height="398" key="GridCell.Tab.0.left" timestamp="1597041384343">
<state width="1814" height="398" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597041528191" />
<state width="1814" height="398" key="GridCell.Tab.0.left" timestamp="1597041528190">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597041384343" />
<state width="1814" height="398" key="GridCell.Tab.0.right" timestamp="1597041384346">
<state width="1814" height="398" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597041528190" />
<state width="1814" height="398" key="GridCell.Tab.0.right" timestamp="1597041528192">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597041384346" />
<state width="1814" height="398" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597041528192" />
<state x="67" y="27" width="1521" height="1053" key="SettingsEditor" timestamp="1596677393346">
<screen x="67" y="27" width="1853" height="1053" />
</state>

@ -0,0 +1,4 @@
熟悉了git的基本使用方法在计算机上配置了相关环境
使用账号登录的时候出现登录问题,密码一直提示错误,最后用组长的账号成功登录,因为不影响提交所以没有特意去研究原因
初次进行了提交文件和删除文件的工作
创建了自己的分支,用于以后提交
Loading…
Cancel
Save