{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:38.686015Z",
     "start_time": "2020-03-23T13:46:38.053923Z"
    }
   },
   "outputs": [],
   "source": [
    "import requests, json\n",
    "import pyecharts\n",
    "import pandas as pd\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts import options as opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:40.287302Z",
     "start_time": "2020-03-23T13:46:39.580518Z"
    }
   },
   "outputs": [],
   "source": [
    "# 获取新冠肺炎最新的全球数据\n",
    "resp = requests.get(\"https://lab.isaaclin.cn/nCoV/api/area?latest=1\")\n",
    "data_json=resp.json()\n",
    "data_global=data_json.get(\"results\")\n",
    "df_global = pd.read_json(json.dumps(data_global),orient='records')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:41.133997Z",
     "start_time": "2020-03-23T13:46:41.114981Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cities</th>\n",
       "      <th>comment</th>\n",
       "      <th>confirmedCount</th>\n",
       "      <th>continentName</th>\n",
       "      <th>countryName</th>\n",
       "      <th>curedCount</th>\n",
       "      <th>currentConfirmedCount</th>\n",
       "      <th>deadCount</th>\n",
       "      <th>locationId</th>\n",
       "      <th>provinceName</th>\n",
       "      <th>provinceShortName</th>\n",
       "      <th>suspectedCount</th>\n",
       "      <th>updateTime</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td>509</td>\n",
       "      <td>亚洲</td>\n",
       "      <td>新加坡</td>\n",
       "      <td>152</td>\n",
       "      <td>355</td>\n",
       "      <td>2</td>\n",
       "      <td>952009</td>\n",
       "      <td>新加坡</td>\n",
       "      <td>新加坡</td>\n",
       "      <td>0</td>\n",
       "      <td>1584971012451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td>1450</td>\n",
       "      <td>欧洲</td>\n",
       "      <td>丹麦</td>\n",
       "      <td>1</td>\n",
       "      <td>1436</td>\n",
       "      <td>13</td>\n",
       "      <td>962001</td>\n",
       "      <td>丹麦</td>\n",
       "      <td>丹麦</td>\n",
       "      <td>0</td>\n",
       "      <td>1584970149379</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td>1089</td>\n",
       "      <td>亚洲</td>\n",
       "      <td>日本</td>\n",
       "      <td>285</td>\n",
       "      <td>763</td>\n",
       "      <td>41</td>\n",
       "      <td>951002</td>\n",
       "      <td>日本</td>\n",
       "      <td>日本</td>\n",
       "      <td>0</td>\n",
       "      <td>1584970149379</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td>2060</td>\n",
       "      <td>欧洲</td>\n",
       "      <td>葡萄牙</td>\n",
       "      <td>14</td>\n",
       "      <td>2023</td>\n",
       "      <td>23</td>\n",
       "      <td>965010</td>\n",
       "      <td>葡萄牙</td>\n",
       "      <td>葡萄牙</td>\n",
       "      <td>0</td>\n",
       "      <td>1584969155012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td>3611</td>\n",
       "      <td>欧洲</td>\n",
       "      <td>奥地利</td>\n",
       "      <td>9</td>\n",
       "      <td>3586</td>\n",
       "      <td>16</td>\n",
       "      <td>963001</td>\n",
       "      <td>奥地利</td>\n",
       "      <td>奥地利</td>\n",
       "      <td>0</td>\n",
       "      <td>1584968822828</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  cities comment  confirmedCount continentName countryName  curedCount  \\\n",
       "0   None                     509            亚洲         新加坡         152   \n",
       "1   None                    1450            欧洲          丹麦           1   \n",
       "2   None                    1089            亚洲          日本         285   \n",
       "3   None                    2060            欧洲         葡萄牙          14   \n",
       "4   None                    3611            欧洲         奥地利           9   \n",
       "\n",
       "   currentConfirmedCount  deadCount  locationId provinceName  \\\n",
       "0                    355          2      952009          新加坡   \n",
       "1                   1436         13      962001           丹麦   \n",
       "2                    763         41      951002           日本   \n",
       "3                   2023         23      965010          葡萄牙   \n",
       "4                   3586         16      963001          奥地利   \n",
       "\n",
       "  provinceShortName  suspectedCount     updateTime  \n",
       "0               新加坡               0  1584971012451  \n",
       "1                丹麦               0  1584970149379  \n",
       "2                日本               0  1584970149379  \n",
       "3               葡萄牙               0  1584969155012  \n",
       "4               奥地利               0  1584968822828  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看数据\n",
    "df_global.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:42.269215Z",
     "start_time": "2020-03-23T13:46:42.261197Z"
    }
   },
   "outputs": [],
   "source": [
    "# 只取关心的数据列\n",
    "selected_cloumns = ['countryName','provinceShortName','provinceName','confirmedCount','currentConfirmedCount','deadCount','curedCount','updateTime']\n",
    "# 过滤出确诊人数过千的海外国家的数据并按确诊人数倒序排列\n",
    "df_selected_oversea=df_global[df_global.countryName!='中国'][selected_cloumns]\n",
    "df_sorted_oversea=df_selected_oversea[df_selected_oversea.confirmedCount>1000].sort_values(by='confirmedCount', ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:43.279822Z",
     "start_time": "2020-03-23T13:46:43.269827Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>countryName</th>\n",
       "      <th>provinceShortName</th>\n",
       "      <th>provinceName</th>\n",
       "      <th>confirmedCount</th>\n",
       "      <th>currentConfirmedCount</th>\n",
       "      <th>deadCount</th>\n",
       "      <th>curedCount</th>\n",
       "      <th>updateTime</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>意大利</td>\n",
       "      <td>意大利</td>\n",
       "      <td>意大利</td>\n",
       "      <td>59514</td>\n",
       "      <td>47014</td>\n",
       "      <td>5476</td>\n",
       "      <td>7024</td>\n",
       "      <td>1584963423867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>美国</td>\n",
       "      <td>美国</td>\n",
       "      <td>美国</td>\n",
       "      <td>35227</td>\n",
       "      <td>34580</td>\n",
       "      <td>471</td>\n",
       "      <td>176</td>\n",
       "      <td>1584968286434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>西班牙</td>\n",
       "      <td>西班牙</td>\n",
       "      <td>西班牙</td>\n",
       "      <td>33089</td>\n",
       "      <td>27552</td>\n",
       "      <td>2182</td>\n",
       "      <td>3355</td>\n",
       "      <td>1584964629818</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>德国</td>\n",
       "      <td>德国</td>\n",
       "      <td>德国</td>\n",
       "      <td>26220</td>\n",
       "      <td>25843</td>\n",
       "      <td>111</td>\n",
       "      <td>266</td>\n",
       "      <td>1584963423867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>伊朗</td>\n",
       "      <td>伊朗</td>\n",
       "      <td>伊朗</td>\n",
       "      <td>23049</td>\n",
       "      <td>13324</td>\n",
       "      <td>1812</td>\n",
       "      <td>7913</td>\n",
       "      <td>1584963423867</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    countryName provinceShortName provinceName  confirmedCount  \\\n",
       "170         意大利               意大利          意大利           59514   \n",
       "6            美国                美国           美国           35227   \n",
       "13          西班牙               西班牙          西班牙           33089   \n",
       "44           德国                德国           德国           26220   \n",
       "158          伊朗                伊朗           伊朗           23049   \n",
       "\n",
       "     currentConfirmedCount  deadCount  curedCount     updateTime  \n",
       "170                  47014       5476        7024  1584963423867  \n",
       "6                    34580        471         176  1584968286434  \n",
       "13                   27552       2182        3355  1584964629818  \n",
       "44                   25843        111         266  1584963423867  \n",
       "158                  13324       1812        7913  1584963423867  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看过滤排序后的数据\n",
    "df_sorted_oversea.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:44.321444Z",
     "start_time": "2020-03-23T13:46:44.315422Z"
    }
   },
   "outputs": [],
   "source": [
    "# 定义绘制南丁格尔玫瑰图的函数\n",
    "def plot_rose(item_list, data_list, title_string):\n",
    "    ziped_item_data_list = [list(z) for z in zip(item_list, data_list)]\n",
    "\n",
    "    rose_diagram = Pie(init_opts=opts.InitOpts(width='650px', height='650px'))\n",
    "    rose_diagram.add(\"\", ziped_item_data_list, radius=[\"40%\", \"130%\"], center=[\"50%\", \"70%\"], rosetype=\"area\")\n",
    "    rose_diagram.set_global_opts(title_opts=opts.TitleOpts(title=title_string),\n",
    "                                 legend_opts=opts.LegendOpts(is_show=False),\n",
    "                                 toolbox_opts=opts.ToolboxOpts()\n",
    "                                )\n",
    "    label_opts = opts.LabelOpts(is_show=True, position=\"inside\", font_size=12, formatter=\"{b}:{c}人\")\n",
    "    rose_diagram.set_series_opts(label_opts=label_opts)\n",
    "    rose_diagram.render('{}.html'.format(title_string))\n",
    "    return rose_diagram"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:45.281354Z",
     "start_time": "2020-03-23T13:46:45.278336Z"
    }
   },
   "outputs": [],
   "source": [
    "# 准备绘图使用的数据，仅取海外确诊过千国家的数据\n",
    "item_oversea_list = df_sorted_oversea['countryName'].values.tolist()\n",
    "data_oversea_list = df_sorted_oversea['confirmedCount'].values.tolist()\n",
    "title_string = \"海外各国确诊人数（仅过千的国家）\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:46.133554Z",
     "start_time": "2020-03-23T13:46:46.105660Z"
    }
   },
   "outputs": [],
   "source": [
    "# 绘制玫瑰图\n",
    "rose2 = plot_rose(item_oversea_list, data_oversea_list, title_string)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-23T13:46:54.039944Z",
     "start_time": "2020-03-23T13:46:54.029954Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"876c27f9c3014560bc4395fba4c03c81\" style=\"width:650px; height:650px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_876c27f9c3014560bc4395fba4c03c81 = echarts.init(\n",
       "                    document.getElementById('876c27f9c3014560bc4395fba4c03c81'), 'white', {renderer: 'canvas'});\n",
       "                var option_876c27f9c3014560bc4395fba4c03c81 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u610f\\u5927\\u5229\",\n",
       "                    \"value\": 59514\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7f8e\\u56fd\",\n",
       "                    \"value\": 35227\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u73ed\\u7259\",\n",
       "                    \"value\": 33089\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5fb7\\u56fd\",\n",
       "                    \"value\": 26220\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4f0a\\u6717\",\n",
       "                    \"value\": 23049\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cd5\\u56fd\",\n",
       "                    \"value\": 16018\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u97e9\\u56fd\",\n",
       "                    \"value\": 8961\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u745e\\u58eb\",\n",
       "                    \"value\": 8060\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u82f1\\u56fd\",\n",
       "                    \"value\": 5683\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8377\\u5170\",\n",
       "                    \"value\": 4204\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6bd4\\u5229\\u65f6\",\n",
       "                    \"value\": 3743\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5965\\u5730\\u5229\",\n",
       "                    \"value\": 3611\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u632a\\u5a01\",\n",
       "                    \"value\": 2532\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8461\\u8404\\u7259\",\n",
       "                    \"value\": 2060\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u745e\\u5178\",\n",
       "                    \"value\": 1929\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6fb3\\u5927\\u5229\\u4e9a\",\n",
       "                    \"value\": 1709\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5df4\\u897f\",\n",
       "                    \"value\": 1546\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9a6c\\u6765\\u897f\\u4e9a\",\n",
       "                    \"value\": 1518\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u52a0\\u62ff\\u5927\",\n",
       "                    \"value\": 1472\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e39\\u9ea6\",\n",
       "                    \"value\": 1450\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4ee5\\u8272\\u5217\",\n",
       "                    \"value\": 1238\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u571f\\u8033\\u5176\",\n",
       "                    \"value\": 1236\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6377\\u514b\",\n",
       "                    \"value\": 1165\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65e5\\u672c\",\n",
       "                    \"value\": 1089\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"130%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"70%\"\n",
       "            ],\n",
       "            \"roseType\": \"area\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"inside\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 12,\n",
       "                \"formatter\": \"{b}:{c}\\u4eba\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5927\\u5229\",\n",
       "                \"\\u7f8e\\u56fd\",\n",
       "                \"\\u897f\\u73ed\\u7259\",\n",
       "                \"\\u5fb7\\u56fd\",\n",
       "                \"\\u4f0a\\u6717\",\n",
       "                \"\\u6cd5\\u56fd\",\n",
       "                \"\\u97e9\\u56fd\",\n",
       "                \"\\u745e\\u58eb\",\n",
       "                \"\\u82f1\\u56fd\",\n",
       "                \"\\u8377\\u5170\",\n",
       "                \"\\u6bd4\\u5229\\u65f6\",\n",
       "                \"\\u5965\\u5730\\u5229\",\n",
       "                \"\\u632a\\u5a01\",\n",
       "                \"\\u8461\\u8404\\u7259\",\n",
       "                \"\\u745e\\u5178\",\n",
       "                \"\\u6fb3\\u5927\\u5229\\u4e9a\",\n",
       "                \"\\u5df4\\u897f\",\n",
       "                \"\\u9a6c\\u6765\\u897f\\u4e9a\",\n",
       "                \"\\u52a0\\u62ff\\u5927\",\n",
       "                \"\\u4e39\\u9ea6\",\n",
       "                \"\\u4ee5\\u8272\\u5217\",\n",
       "                \"\\u571f\\u8033\\u5176\",\n",
       "                \"\\u6377\\u514b\",\n",
       "                \"\\u65e5\\u672c\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6d77\\u5916\\u5404\\u56fd\\u786e\\u8bca\\u4eba\\u6570\\uff08\\u4ec5\\u8fc7\\u5343\\u7684\\u56fd\\u5bb6\\uff09\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_876c27f9c3014560bc4395fba4c03c81.setOption(option_876c27f9c3014560bc4395fba4c03c81);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x279eb5c0278>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 将绘制的图渲染在juypter notebook中\n",
    "rose2.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": "block",
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
