From 78f10caaca1110cfcb5e9d7ba0a4ccdb390d2c68 Mon Sep 17 00:00:00 2001 From: yangxudongll <1593744164@qq.com> Date: Tue, 11 Aug 2020 19:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E5=86=85=E7=96=AB=E6=83=85=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/models.cpython-36.pyc | Bin 2208 -> 2208 bytes .../新冠疫情/hello.py | 5 +- .../新冠疫情/templates/index.html | 196 +++++------------- 3 files changed, 60 insertions(+), 141 deletions(-) diff --git a/数据分析和可视化/新冠疫情/__pycache__/models.cpython-36.pyc b/数据分析和可视化/新冠疫情/__pycache__/models.cpython-36.pyc index 2e4b59f483e36326a3d6a3217eb9cc93b2010299..5ad41f72a9f723e6c4ee907aaceec547a235ddb3 100644 GIT binary patch delta 16 XcmZ1=xImEIn3tF9MTyZy_L&?2CY1!J delta 16 XcmZ1=xImEIn3tDp`dfpI>@zt4Cn^Na diff --git a/数据分析和可视化/新冠疫情/hello.py b/数据分析和可视化/新冠疫情/hello.py index 19b99af..fdb40f3 100644 --- a/数据分析和可视化/新冠疫情/hello.py +++ b/数据分析和可视化/新冠疫情/hello.py @@ -29,12 +29,13 @@ def chinasummary(): results=db.searchSummaryChina(nowtime) results=results[0] #获取各省份疫情数据 - provinces=db. + provinces=db.searchProvinceConfirmed(nowtime) data=jsonify(curConfirm=results[1],curConfirmRelative=results[2], confirmed=results[9],confirmedRelative=results[10], cured=results[13],curedRelative=results[14],died=results[15], - diedRelative=results[16],updateTime=nowtime) + diedRelative=results[16],updateTime=nowtime,area=[x[0] for x in provinces], + proconfirmed=[x[1] for x in provinces]) return data diff --git a/数据分析和可视化/新冠疫情/templates/index.html b/数据分析和可视化/新冠疫情/templates/index.html index 2a5c2e6..c9d7460 100644 --- a/数据分析和可视化/新冠疫情/templates/index.html +++ b/数据分析和可视化/新冠疫情/templates/index.html @@ -25,6 +25,10 @@ + + @@ -121,9 +125,14 @@   疫情概览 -
- - +
+
+
+
+
+ 当前确诊人数最多省份 + +
@@ -184,135 +193,6 @@
- -

截止2020-02-02 11:52全国数据统计

- -
-
-

较昨日+110

-

0

-
确诊病例
-
-
-

较昨日+110

-

0

-
疑似病例
-
-
-

较昨日+110

-

0

-
死亡人数
-
-
-

较昨日+110

-

0

-
治愈人数
-
-
- - -
-
- -

- 病毒: - 新型冠状病毒 2019-nCoV -

-
-
- -

- 传染源: - 野生动物,可能为中华菊头蝠 -

-
-
- -

- 传播途径: - 经呼吸道飞沫传播,亦可通过接触传播,存在粪-口传播可能性 -

-
-
- -

- 易感人群: - 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病 -

-
-
- -

- 潜伏期: - 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性 -

-
-
- - -
-
- -   疫情概览 -
-
- -
-
- - -
- -
- -
- - - -
-
- -   全国数据统计 -
-
-
-
- 地区 - 确诊 - 死亡 - 治愈 -
- -
- - -
-
- -   海外数据统计 -
-
-
-
- 地区 - 确诊 - 死亡 - 治愈 -
- -
-
@@ -380,19 +260,51 @@ for (var i = 0; i < ospan.length; i++) { } }; var dataList=[] - var myChart = echarts.init(document.getElementById('main')); + var myChart = echarts.init(document.getElementById('map_echarts')); option = { tooltip: { formatter:function(params,ticket, callback){ return params.seriesName+'
'+params.name+':'+params.value }//数据格式化 }, - visualMap: { - left: 'left', - top: 'bottom', - text: ['高','低'],//取值范围的文字 - show:true//图注 - }, + visualMap: { + min: 0, + max: 100000, + left: 10, + bottom: 40, + itemWidth: 5, //图元的宽 + itemHeight: 5, //图元的高 + itemGap: 5, //两个图元之间的间隔距离 + textStyle: { + fontSize: 9, //图元字体大小 + }, + pieces: [{ + gt: 10000, + label: "> 10000", + color: "#7f1100" + }, { + gte: 1000, + lte: 10000, + label: "1000 - 10000", + color: "#ff5428" + }, { + gte: 500, + lt: 1000, + label: "500 - 1000", + color: "#ff8c71" + }, { + gt: 100, + lt: 500, + label: "100 - 500", + color: "#ffd768" + }, { + gt: 0, + lt: 100, + label: "0 - 100", + color: "rgb(253,235,207)" + }], + show: true + }, geo: { map: 'china', roam: false,//不开启缩放和平移 @@ -445,6 +357,12 @@ $.ajax({ $(".add_num3").html(results.diedRelative); //新增死亡人数 $(".num4").html(results.cured); //治愈人数 $(".add_num4").html(results.curedRelative); //新增治愈人数 + cityName=results.area; + proconfirmed=results.proconfirmed; + for(i=0;i