{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# pyecharts\n", "\n", "pyecharts is a library to generate charts using Echarts. It simply provides the interface of 28+ kinds of charts between Echarts and Python. https://github.com/pyecharts/pyecharts\n", "\n", "> pip install pyecharts\n", " \n", "> pip install echarts-countries-pypkg\n", "\n", "> pip install echarts-china-provinces-pypkg\n", "\n", "> pip install echarts-china-cities-pypkg" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "http://nbviewer.jupyter.org/github/pyecharts/pyecharts-users-cases/blob/master/notebook-users-cases/notebook-user-cases.ipynb" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Bar" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:01:19.434123Z", "start_time": "2018-05-06T07:01:19.142243Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Bar\n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "v1 = [5, 20, 36, 10, 75, 90]\n", "v2 = [10, 25, 8, 60, 20, 80]\n", "bar = Bar(\"柱状图数据堆叠示例\")\n", "bar.add(\"商家A\", attr, v1, is_stack=True)\n", "bar.add(\"商家B\", attr, v2, is_stack=True)\n", "\n", "bar" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bar = Bar(\"柱状图示例\")\n", "bar.add(\"商家A\", attr, v1, is_stack=False)\n", "bar.add(\"商家B\", attr, v2, is_stack=False)\n", "\n", "bar" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bar = Bar(\"标记线和标记点示例\")\n", "bar.add(\"商家A\", attr, v1, mark_point=[\"average\"])\n", "bar.add(\"商家B\", attr, v2, mark_line=[\"min\", \"max\"])\n", "\n", "bar" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bar = Bar(\"x 轴和 y 轴交换\")\n", "bar.add(\"商家A\", attr, v1)\n", "bar.add(\"商家B\", attr, v2, is_convert=True)\n", "\n", "bar" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import random\n", "\n", "attr = [\"{}天\".format(i) for i in range(30)]\n", "v1 = [random.randint(1, 30) for _ in range(30)]\n", "bar = Bar(\"Bar - datazoom - slider 示例\")\n", "bar.add(\"\", attr, v1, is_label_show=True, is_datazoom_show=True)\n", "\n", "bar" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "attr = [\"{}天\".format(i) for i in range(20)]\n", "v1 = [random.randint(1, 20) for _ in range(20)]\n", "bar = Bar(\"坐标轴标签旋转示例\")\n", "bar.add(\"\", attr, v1, xaxis_interval=0, xaxis_rotate=30, yaxis_rotate=30)\n", "\n", "bar" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Bar3D" ] }, { "cell_type": "code", "execution_count": 147, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Bar3D\n", "\n", "bar3d = Bar3D(\"3D 柱状图示例\", width=1200, height=600)\n", "x_axis = [\"12a\", \"1a\", \"2a\", \"3a\", \"4a\", \"5a\", \"6a\", \"7a\", \"8a\", \"9a\", \"10a\", \"11a\",\n", " \"12p\", \"1p\", \"2p\", \"3p\", \"4p\", \"5p\", \"6p\", \"7p\", \"8p\", \"9p\", \"10p\", \"11p\"]\n", "y_aixs = [\"Saturday\", \"Friday\", \"Thursday\", \"Wednesday\", \"Tuesday\", \"Monday\", \"Sunday\"]\n", "data = [[0, 0, 5], [0, 1, 1], [0, 2, 0], [0, 3, 0], [0, 4, 0], [0, 5, 0], [0, 6, 0], [0, 7, 0],\n", " [0, 8, 0],[0, 9, 0], [0, 10, 0], [0, 11, 2], [0, 12, 4], [0, 13, 1], [0, 14, 1], [0, 15, 3],\n", " [0, 16, 4], [0, 17, 6], [0, 18, 4], [0, 19, 4], [0, 20, 3], [0, 21, 3], [0, 22, 2], [0, 23, 5],\n", " [1, 0, 7], [1, 1, 0], [1, 2, 0], [1, 3, 0], [1, 4, 0], [1, 5, 0], [1, 6, 0], [1, 7, 0], [1, 8, 0],\n", " [1, 9, 0], [1, 10, 5], [1, 11, 2], [1, 12, 2], [1, 13, 6], [1, 14, 9], [1, 15, 11], [1, 16, 6], [1, 17, 7],\n", " [1, 18, 8], [1, 19, 12], [1, 20, 5], [1, 21, 5], [1, 22, 7], [1, 23, 2], [2, 0, 1], [2, 1, 1],\n", " [2, 2, 0], [2, 3, 0], [2, 4, 0], [2, 5, 0], [2, 6, 0], [2, 7, 0], [2, 8, 0], [2, 9, 0], [2, 10, 3],\n", " [2, 11, 2], [2, 12, 1], [2, 13, 9], [2, 14, 8], [2, 15, 10], [2, 16, 6], [2, 17, 5], [2, 18, 5],\n", " [2, 19, 5], [2, 20, 7], [2, 21, 4], [2, 22, 2], [2, 23, 4], [3, 0, 7], [3, 1, 3], [3, 2, 0], [3, 3, 0],\n", " [3, 4, 0], [3, 5, 0], [3, 6, 0], [3, 7, 0], [3, 8, 1], [3, 9, 0], [3, 10, 5], [3, 11, 4], [3, 12, 7],\n", " [3, 13, 14], [3, 14, 13], [3, 15, 12], [3, 16, 9], [3, 17, 5], [3, 18, 5], [3, 19, 10], [3, 20, 6],\n", " [3, 21, 4], [3, 22, 4], [3, 23, 1], [4, 0, 1], [4, 1, 3], [4, 2, 0], [4, 3, 0], [4, 4, 0], [4, 5, 1],\n", " [4, 6, 0], [4, 7, 0], [4, 8, 0], [4, 9, 2], [4, 10, 4], [4, 11, 4], [4, 12, 2], [4, 13, 4], [4, 14, 4],\n", " [4, 15, 14], [4, 16, 12], [4, 17, 1], [4, 18, 8], [4, 19, 5], [4, 20, 3], [4, 21, 7], [4, 22, 3],\n", " [4, 23, 0], [5, 0, 2], [5, 1, 1], [5, 2, 0], [5, 3, 3], [5, 4, 0], [5, 5, 0], [5, 6, 0], [5, 7, 0],\n", " [5, 8, 2], [5, 9, 0], [5, 10, 4], [5, 11, 1], [5, 12, 5], [5, 13, 10], [5, 14, 5], [5, 15, 7], [5, 16, 11],\n", " [5, 17, 6], [5, 18, 0], [5, 19, 5], [5, 20, 3], [5, 21, 4], [5, 22, 2], [5, 23, 0], [6, 0, 1], [6, 1, 0],\n", " [6, 2, 0], [6, 3, 0], [6, 4, 0], [6, 5, 0], [6, 6, 0], [6, 7, 0], [6, 8, 0], [6, 9, 0], [6, 10, 1],\n", " [6, 11, 0], [6, 12, 2], [6, 13, 1], [6, 14, 3], [6, 15, 4], [6, 16, 0], [6, 17, 0], [6, 18, 0], [6, 19, 0],\n", " [6, 20, 1], [6, 21, 2], [6, 22, 2], [6, 23, 6]]" ] }, { "cell_type": "code", "execution_count": 148, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 148, "metadata": {}, "output_type": "execute_result" } ], "source": [ "range_color = ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf',\n", " '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']\n", "bar3d.add(\"\", x_axis, y_aixs, [[d[1], d[0], d[2]] for d in data], is_visualmap=True,\n", " visual_range=[0, 20], visual_range_color=range_color, grid3d_width=200, grid3d_depth=80)\n", "\n", "bar3d" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# EffectScatter" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import EffectScatter\n", "\n", "es = EffectScatter(\"动态散点图各种图形示例\")\n", "es.add(\"\", [10], [10], symbol_size=20, effect_scale=3.5, effect_period=3, symbol=\"pin\")\n", "es.add(\"\", [20], [20], symbol_size=12, effect_scale=4.5, effect_period=4,symbol=\"rect\")\n", "es.add(\"\", [30], [30], symbol_size=30, effect_scale=5.5, effect_period=5,symbol=\"roundRect\")\n", "es.add(\"\", [40], [40], symbol_size=10, effect_scale=6.5, effect_brushtype='fill',symbol=\"diamond\")\n", "es.add(\"\", [50], [50], symbol_size=16, effect_scale=5.5, effect_period=3,symbol=\"arrow\")\n", "es.add(\"\", [60], [60], symbol_size=6, effect_scale=2.5, effect_period=3,symbol=\"triangle\")\n", "\n", "es" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Funnel" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Funnel\n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "value = [20, 40, 60, 80, 100, 120]\n", "funnel = Funnel(\"漏斗图示例\")\n", "funnel.add(\"商品\", attr, value, is_label_show=True, label_pos=\"inside\", label_text_color=\"#fff\")\n", "\n", "funnel" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Gauge" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Gauge\n", "\n", "gauge = Gauge(\"仪表盘示例\")\n", "gauge.add(\"业务指标\", \"完成率\", 66.66)\n", "\n", "gauge" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Geo" ] }, { "cell_type": "code", "execution_count": 145, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Geo\n", "\n", "data = [\n", " (\"海门\", 9),(\"鄂尔多斯\", 12),(\"招远\", 12),(\"舟山\", 12),(\"齐齐哈尔\", 14),(\"盐城\", 15),\n", " (\"赤峰\", 16),(\"青岛\", 18),(\"乳山\", 18),(\"金昌\", 19),(\"泉州\", 21),(\"莱西\", 21),\n", " (\"日照\", 21),(\"胶南\", 22),(\"南通\", 23),(\"拉萨\", 24),(\"云浮\", 24),(\"梅州\", 25),\n", " (\"文登\", 25),(\"上海\", 25),(\"攀枝花\", 25),(\"威海\", 25),(\"承德\", 25),(\"厦门\", 26),\n", " (\"汕尾\", 26),(\"潮州\", 26),(\"丹东\", 27),(\"太仓\", 27),(\"曲靖\", 27),(\"烟台\", 28),\n", " (\"福州\", 29),(\"瓦房店\", 30),(\"即墨\", 30),(\"抚顺\", 31),(\"玉溪\", 31),(\"张家口\", 31),\n", " (\"阳泉\", 31),(\"莱州\", 32),(\"湖州\", 32),(\"汕头\", 32),(\"昆山\", 33),(\"宁波\", 33),\n", " (\"湛江\", 33),(\"揭阳\", 34),(\"荣成\", 34),(\"连云港\", 35),(\"葫芦岛\", 35),(\"常熟\", 36),\n", " (\"东莞\", 36),(\"河源\", 36),(\"淮安\", 36),(\"泰州\", 36),(\"南宁\", 37),(\"营口\", 37),\n", " (\"惠州\", 37),(\"江阴\", 37),(\"蓬莱\", 37),(\"韶关\", 38),(\"嘉峪关\", 38),(\"广州\", 38),\n", " (\"延安\", 38),(\"太原\", 39),(\"清远\", 39),(\"中山\", 39),(\"昆明\", 39),(\"寿光\", 40),\n", " (\"盘锦\", 40),(\"长治\", 41),(\"深圳\", 41),(\"珠海\", 42),(\"宿迁\", 43),(\"咸阳\", 43),\n", " (\"铜川\", 44),(\"平度\", 44),(\"佛山\", 44),(\"海口\", 44),(\"江门\", 45),(\"章丘\", 45),\n", " (\"肇庆\", 46),(\"大连\", 47),(\"临汾\", 47),(\"吴江\", 47),(\"石嘴山\", 49),(\"沈阳\", 50),\n", " (\"苏州\", 50),(\"茂名\", 50),(\"嘉兴\", 51),(\"长春\", 51),(\"胶州\", 52),(\"银川\", 52),\n", " (\"张家港\", 52),(\"三门峡\", 53),(\"锦州\", 54),(\"南昌\", 54),(\"柳州\", 54),(\"三亚\", 54),\n", " (\"自贡\", 56),(\"吉林\", 56),(\"阳江\", 57),(\"泸州\", 57),(\"西宁\", 57),(\"宜宾\", 58),\n", " (\"呼和浩特\", 58),(\"成都\", 58),(\"大同\", 58),(\"镇江\", 59),(\"桂林\", 59),(\"张家界\", 59),\n", " (\"宜兴\", 59),(\"北海\", 60),(\"西安\", 61),(\"金坛\", 62),(\"东营\", 62),(\"牡丹江\", 63),\n", " (\"遵义\", 63),(\"绍兴\", 63),(\"扬州\", 64),(\"常州\", 64),(\"潍坊\", 65),(\"重庆\", 66),\n", " (\"台州\", 67),(\"南京\", 67),(\"滨州\", 70),(\"贵阳\", 71),(\"无锡\", 71),(\"本溪\", 71),\n", " (\"克拉玛依\", 72),(\"渭南\", 72),(\"马鞍山\", 72),(\"宝鸡\", 72),(\"焦作\", 75),(\"句容\", 75),\n", " (\"北京\", 79),(\"徐州\", 79),(\"衡水\", 80),(\"包头\", 80),(\"绵阳\", 80),(\"乌鲁木齐\", 84),\n", " (\"枣庄\", 84),(\"杭州\", 84),(\"淄博\", 85),(\"鞍山\", 86),(\"溧阳\", 86),(\"库尔勒\", 86),\n", " (\"安阳\", 90),(\"开封\", 90),(\"济南\", 92),(\"德阳\", 93),(\"温州\", 95),(\"九江\", 96),\n", " (\"邯郸\", 98),(\"临安\", 99),(\"兰州\", 99),(\"沧州\", 100),(\"临沂\", 103),(\"南充\", 104),\n", " (\"天津\", 105),(\"富阳\", 106),(\"泰安\", 112),(\"诸暨\", 112),(\"郑州\", 113),(\"哈尔滨\", 114),\n", " (\"聊城\", 116),(\"芜湖\", 117),(\"唐山\", 119),(\"平顶山\", 119),(\"邢台\", 119),(\"德州\", 120),\n", " (\"济宁\", 120),(\"荆州\", 127),(\"宜昌\", 130),(\"义乌\", 132),(\"丽水\", 133),(\"洛阳\", 134),\n", " (\"秦皇岛\", 136),(\"株洲\", 143),(\"石家庄\", 147),(\"莱芜\", 148),(\"常德\", 152),(\"保定\", 153),\n", " (\"湘潭\", 154),(\"金华\", 157),(\"岳阳\", 169),(\"长沙\", 175),(\"衢州\", 177),(\"廊坊\", 193),\n", " (\"菏泽\", 194),(\"合肥\", 229),(\"武汉\", 273),(\"大庆\", 279)]" ] }, { "cell_type": "code", "execution_count": 146, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 146, "metadata": {}, "output_type": "execute_result" } ], "source": [ "geo = Geo(\"全国主要城市空气质量\", \"data from pm2.5\", title_color=\"#fff\", title_pos=\"center\",\n", "width=1200, height=600, background_color='#404a59')\n", "attr, value = geo.cast(data)\n", "geo.add(\"\", attr, value, visual_range=[0, 200], visual_text_color=\"#fff\", symbol_size=15, is_visualmap=True)\n", "\n", "geo" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "geo = Geo(\"全国主要城市空气质量\", \"data from pm2.5\", title_color=\"#fff\", title_pos=\"center\", width=1200, height=600,\n", " background_color='#404a59')\n", "attr, value = geo.cast(data)\n", "geo.add(\"\", attr, value, type=\"heatmap\", is_visualmap=True, visual_range=[0, 300], visual_text_color='#fff')\n", "\n", "geo" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Graph" ] }, { "cell_type": "code", "execution_count": 143, "metadata": {}, "outputs": [], "source": [ "from pyecharts import Graph\n", "\n", "nodes = [{\"name\": \"结点1\", \"symbolSize\": 10},\n", " {\"name\": \"结点2\", \"symbolSize\": 20},\n", " {\"name\": \"结点3\", \"symbolSize\": 30},\n", " {\"name\": \"结点4\", \"symbolSize\": 40},\n", " {\"name\": \"结点5\", \"symbolSize\": 50},\n", " {\"name\": \"结点6\", \"symbolSize\": 40},\n", " {\"name\": \"结点7\", \"symbolSize\": 30},\n", " {\"name\": \"结点8\", \"symbolSize\": 20}]" ] }, { "cell_type": "code", "execution_count": 144, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 144, "metadata": {}, "output_type": "execute_result" } ], "source": [ "links = []\n", "for i in nodes:\n", " for j in nodes:\n", " links.append({\"source\": i.get('name'), \"target\": j.get('name')})\n", "graph = Graph(\"关系图-力引导布局示例\")\n", "graph.add(\"\", nodes, links, repulsion=8000)\n", "\n", "graph" ] }, { "cell_type": "code", "execution_count": 140, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Graph\n", "\n", "nodes = [\n", " { 'name': '乔布斯', 'symbolSize' : 30},\n", " { 'name': '丽萨-乔布斯','symbolSize' : 20},\n", " { 'name': '保罗-乔布斯','symbolSize' : 3},\n", " { 'name': '克拉拉-乔布斯','symbolSize' : 3},\n", " { 'name': '劳伦-鲍威尔','symbolSize' : 7},\n", " { 'name': '史蒂夫-沃兹尼艾克','symbolSize' : 5},\n", " { 'name': '奥巴马','symbolSize' : 8},\n", " { 'name': '比尔-盖茨','symbolSize' : 9},\n", " { 'name': '乔纳森-艾夫','symbolSize' : 4},\n", " { 'name': '蒂姆-库克','symbolSize' : 4},\n", " { 'name': '龙-韦恩','symbolSize' : 1},\n", " ]\n" ] }, { "cell_type": "code", "execution_count": 141, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "relationship = [('丽萨-乔布斯', '乔布斯', 1),\n", " ('保罗-乔布斯', '乔布斯', 2),\n", " ('克拉拉-乔布斯', '乔布斯', 1),\n", " ('劳伦-鲍威尔', '乔布斯', 2),\n", " ('史蒂夫-沃兹尼艾克', '乔布斯', 3),\n", " ('奥巴马', '乔布斯', 1),\n", " ('比尔-盖茨', '乔布斯', 6),\n", " ('乔纳森-艾夫', '乔布斯', 1),\n", " ('蒂姆-库克', '乔布斯', 1),\n", " ('龙-韦恩', '乔布斯', 1),\n", " ('克拉拉-乔布斯', '保罗-乔布斯', 1),\n", " ('奥巴马', '保罗-乔布斯', 1),\n", " ('奥巴马', '克拉拉-乔布斯', 1),\n", " ('奥巴马', '劳伦-鲍威尔', 1),\n", " ('奥巴马', '史蒂夫-沃兹尼艾克', 1),\n", " ('比尔-盖茨', '奥巴马', 6),\n", " ('比尔-盖茨', '克拉拉-乔布斯', 1),\n", " ('蒂姆-库克', '奥巴马', 1)]" ] }, { "cell_type": "code", "execution_count": 142, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 142, "metadata": {}, "output_type": "execute_result" } ], "source": [ "links = []\n", "for i in relationship:\n", " links.append({\"source\": i[0], \"target\": i[1]})\n", "graph = Graph(\"关系图-力引导布局示例2\")\n", "graph.add(\"\", nodes, links, repulsion=200)\n", "\n", "graph" ] }, { "cell_type": "code", "execution_count": 150, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 150, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import networkx as nx\n", "from networkx.readwrite import json_graph\n", "from pyecharts import Graph\n", "\n", "g = nx.Graph()\n", "g.add_node('G1', name='Gateway 1')\n", "g.add_node('N2', name='Node 2')\n", "g.add_node('N3', name='Node 3')\n", "g.add_edge('G1', 'N2')\n", "g.add_edge('G1', 'N3')\n", "g_data = json_graph.node_link_data(g)\n", "eg = Graph('设备最新拓扑图')\n", "eg.add('Devices', nodes=g_data['nodes'], links=g_data['links'])\n", "eg" ] }, { "cell_type": "code", "execution_count": 156, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 156, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ba=nx.barabasi_albert_graph(100,5)\n", "g_data = json_graph.node_link_data(ba)\n", "eg = Graph('BA Network')\n", "eg.add('BA', nodes=g_data['nodes'], links=g_data['links'])\n", "eg" ] }, { "cell_type": "code", "execution_count": 155, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 155, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G=nx.karate_club_graph()\n", "g_data = json_graph.node_link_data(G)\n", "eg = Graph('karate_club')\n", "eg.add('karate_club', nodes=g_data['nodes'], links=g_data['links'])\n", "eg" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# HeatMap" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import HeatMap\n", "\n", "x_axis = [\"12a\", \"1a\", \"2a\", \"3a\", \"4a\", \"5a\", \"6a\", \"7a\", \"8a\", \"9a\", \"10a\", \"11a\",\n", " \"12p\", \"1p\", \"2p\", \"3p\", \"4p\", \"5p\", \"6p\", \"7p\", \"8p\", \"9p\", \"10p\", \"11p\"]\n", "y_aixs = [\"Saturday\", \"Friday\", \"Thursday\", \"Wednesday\", \"Tuesday\", \"Monday\", \"Sunday\"]\n", "data = [[i, j, random.randint(0, 50)] for i in range(24) for j in range(7)]\n", "heatmap = HeatMap()\n", "heatmap.add(\"热力图直角坐标系\", x_axis, y_aixs, data, is_visualmap=True,\n", " visual_text_color=\"#000\", visual_orient='horizontal')\n", "\n", "heatmap" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Kline" ] }, { "cell_type": "code", "execution_count": 138, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Kline\n", "\n", "v1 = [[2320.26, 2320.26, 2287.3, 2362.94], [2300, 2291.3, 2288.26, 2308.38],\n", " [2295.35, 2346.5, 2295.35, 2345.92], [2347.22, 2358.98, 2337.35, 2363.8],\n", " [2360.75, 2382.48, 2347.89, 2383.76], [2383.43, 2385.42, 2371.23, 2391.82],\n", " [2377.41, 2419.02, 2369.57, 2421.15], [2425.92, 2428.15, 2417.58, 2440.38],\n", " [2411, 2433.13, 2403.3, 2437.42], [2432.68, 2334.48, 2427.7, 2441.73],\n", " [2430.69, 2418.53, 2394.22, 2433.89], [2416.62, 2432.4, 2414.4, 2443.03],\n", " [2441.91, 2421.56, 2418.43, 2444.8], [2420.26, 2382.91, 2373.53, 2427.07],\n", " [2383.49, 2397.18, 2370.61, 2397.94], [2378.82, 2325.95, 2309.17, 2378.82],\n", " [2322.94, 2314.16, 2308.76, 2330.88], [2320.62, 2325.82, 2315.01, 2338.78],\n", " [2313.74, 2293.34, 2289.89, 2340.71], [2297.77, 2313.22, 2292.03, 2324.63],\n", " [2322.32, 2365.59, 2308.92, 2366.16], [2364.54, 2359.51, 2330.86, 2369.65],\n", " [2332.08, 2273.4, 2259.25, 2333.54], [2274.81, 2326.31, 2270.1, 2328.14],\n", " [2333.61, 2347.18, 2321.6, 2351.44], [2340.44, 2324.29, 2304.27, 2352.02],\n", " [2326.42, 2318.61, 2314.59, 2333.67], [2314.68, 2310.59, 2296.58, 2320.96],\n", " [2309.16, 2286.6, 2264.83, 2333.29], [2282.17, 2263.97, 2253.25, 2286.33],\n", " [2255.77, 2270.28, 2253.31, 2276.22]]\n" ] }, { "cell_type": "code", "execution_count": 139, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 139, "metadata": {}, "output_type": "execute_result" } ], "source": [ "kline = Kline(\"K 线图示例\")\n", "kline.add(\"日K\", [\"2017/7/{}\".format(i + 1) for i in range(31)], v1)\n", "\n", "kline" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Line" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Line\n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "v1 = [5, 20, 36, 10, 10, 100]\n", "v2 = [55, 60, 16, 20, 15, 80]\n", "line = Line(\"折线图示例\")\n", "line.add(\"商家A\", attr, v1, mark_point=[\"average\"])\n", "line.add(\"商家B\", attr, v2, is_smooth=True, mark_line=[\"max\", \"average\"])\n", "\n", "line" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "line = Line(\"折线图-面积图示例\")\n", "line.add(\"商家A\", attr, v1, is_fill=True, line_opacity=0.2, area_opacity=0.4, symbol=None)\n", "line.add(\"商家B\", attr, v2, is_fill=True, area_color='#000', area_opacity=0.3, is_smooth=True)\n", "\n", "line" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Line3D" ] }, { "cell_type": "code", "execution_count": 136, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Line3D\n", "\n", "import math\n", "_data = []\n", "for t in range(0, 25000):\n", " _t = t / 1000\n", " x = (1 + 0.25 * math.cos(75 * _t)) * math.cos(_t)\n", " y = (1 + 0.25 * math.cos(75 * _t)) * math.sin(_t)\n", " z = _t + 2.0 * math.sin(75 * _t)\n", " _data.append([x, y, z])" ] }, { "cell_type": "code", "execution_count": 137, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 137, "metadata": {}, "output_type": "execute_result" } ], "source": [ "range_color = ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf',\n", " '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']\n", "line3d = Line3D(\"3D 折线图示例\", width=1200, height=600)\n", "line3d.add(\"\", _data, is_visualmap=True, visual_range_color=range_color, visual_range=[0, 30],\n", " is_grid3d_rotate=True, grid3d_rotate_speed=180)\n", "\n", "line3d" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Liquid" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Liquid\n", "\n", "liquid = Liquid(\"水球图示例\")\n", "liquid.add(\"Liquid\", [0.6, 0.5, 0.4, 0.3], is_liquid_outline_show=False)\n", "\n", "liquid" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Map" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Map\n", "\n", "value = [155, 10, 66, 78]\n", "attr = [\"福建\", \"山东\", \"北京\", \"上海\"]\n", "map = Map(\"全国地图示例\", width=1200, height=600)\n", "map.add(\"\", attr, value, maptype='china')\n", "\n", "map" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Map\n", "\n", "value = [20, 90, 453, 77, 65]\n", "attr = ['南京市', '镇江市', '扬州市', '徐州市', '苏州市']\n", "map = Map(\"江苏省地图示例\", width=1200, height=600)\n", "map.add(\"\", attr, value, maptype='江苏', is_visualmap=True, visual_text_color='#000')\n", "\n", "map" ] }, { "cell_type": "code", "execution_count": 134, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "#https://baike.baidu.com/item/沧州\n", "data = [('运河区', 109.92), ('新华区', 109.47), ('泊头市', 1006.5),\n", " ('任丘市', 1023.0), ('黄骅市', 1544.7), ('河间市', 1333.0),\n", " ('沧县', 1104.0), ('青县', 968.0), ('东光县', 730.0),\n", " ('海兴县', 915.1), ('盐山县', 796.0), ('肃宁县', 525.0),\n", " ('南皮县', 794.0), ('吴桥县', 600.0), ('献县', 1191.0),\n", " ('孟村回族自治县', 387.0)]" ] }, { "cell_type": "code", "execution_count": 135, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 135, "metadata": {}, "output_type": "execute_result" } ], "source": [ "districts, areas = zip(*data)\n", "\n", "map = Map(\"沧州市图例-各区面积\", width=1200, height=600)\n", "map.add(\"\", districts, areas, maptype='沧州', is_visualmap=True, visual_range=[min(areas), max(areas)],\n", " visual_text_color='#000', is_map_symbol_show=False, is_label_show=True)\n", "map" ] }, { "cell_type": "code", "execution_count": 111, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "value = [1, 100]\n", "attr = ['Gujarat', 'Tamil Nadu']\n", "map = Map('India', width=800, height=600)\n", "map.add('', attr, value, maptype=u'印度', is_visualmap=True, visual_text_color=\"#000\")\n", "map" ] }, { "cell_type": "code", "execution_count": 31, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "value = [95.1, 23.2, 43.3, 66.4, 88.5]\n", "attr= [\"China\", \"Canada\", \"Brazil\", \"Russia\", \"United States\"]\n", "map = Map(\"世界地图示例\", width=1200, height=600)\n", "map.add(\"\", attr, value, maptype=\"world\", is_visualmap=True, visual_text_color='#000')\n", "\n", "map" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Parallel" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Parallel\n", "\n", "schema = [\"data\", \"AQI\", \"PM2.5\", \"PM10\", \"CO\", \"NO2\"]\n", "data = [[1, 91, 45, 125, 0.82, 34],\n", " [2, 65, 27, 78, 0.86, 45,],\n", " [3, 83, 60, 84, 1.09, 73],\n", " [4, 109, 81, 121, 1.28, 68],\n", " [5, 106, 77, 114, 1.07, 55],\n", " [6, 109, 81, 121, 1.28, 68],\n", " [7, 106, 77, 114, 1.07, 55],\n", " [8, 89, 65, 78, 0.86, 51, 26],\n", " [9, 53, 33, 47, 0.64, 50, 17],\n", " [10, 80, 55, 80, 1.01, 75, 24],\n", " [11, 117, 81, 124, 1.03, 45]]\n", "parallel = Parallel(\"平行坐标系-默认指示器\")\n", "parallel.config(schema) \n", "parallel.add(\"parallel\", data, is_random=True)\n", "\n", "parallel" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Pie" ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Pie\n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "v1 = [11, 12, 13, 10, 10, 10]\n", "pie = Pie(\"饼图示例\")\n", "pie.add(\"\", attr, v1, is_label_show=True)\n", "\n", "pie" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "v1 = [11, 12, 13, 10, 10, 10]\n", "v2 = [19, 21, 32, 20, 20, 33]\n", "pie = Pie(\"饼图-玫瑰图示例\", title_pos='center', width=900)\n", "pie.add(\"商品A\", attr, v1, center=[25, 50], is_random=True, radius=[30, 75], rosetype='radius')\n", "pie.add(\"商品B\", attr, v2, center=[75, 50], is_random=True, radius=[30, 75], rosetype='area',\n", " is_legend_show=False, is_label_show=True)\n", "\n", "pie" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Polar" ] }, { "cell_type": "code", "execution_count": 35, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Polar\n", "\n", "import random\n", "data = [(i, random.randint(1, 100)) for i in range(101)]\n", "polar = Polar(\"极坐标系-散点图示例\")\n", "polar.add(\"\", data, boundary_gap=False, type='scatter', is_splitline_show=False,\n", " area_color=None, is_axisline_show=True)\n", "\n", "polar" ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "radius = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']\n", "polar = Polar(\"极坐标系-堆叠柱状图示例\", width=1200, height=600)\n", "polar.add(\"A\", [1, 2, 3, 4, 3, 5, 1], radius_data=radius, type='barRadius', is_stack=True)\n", "polar.add(\"B\", [2, 4, 6, 1, 2, 3, 1], radius_data=radius, type='barRadius', is_stack=True)\n", "polar.add(\"C\", [1, 2, 3, 4, 1, 2, 5], radius_data=radius, type='barRadius', is_stack=True)\n", "\n", "polar" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Radar" ] }, { "cell_type": "code", "execution_count": 89, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Radar\n", "\n", "schema = [ \n", " (\"销售\", 6500), (\"管理\", 16000), (\"信息技术\", 30000), (\"客服\", 38000), (\"研发\", 52000), (\"市场\", 25000)]\n", "v1 = [[4300, 10000, 28000, 35000, 50000, 19000]]\n", "v2 = [[5000, 14000, 28000, 31000, 42000, 21000]]\n", "radar = Radar()\n", "radar.config(schema)\n", "radar.add(\"预算分配\", v1, is_splitline=True, is_axisline_show=True)\n", "radar.add(\"实际开销\", v2, label_color=[\"#4e79a7\"], is_area_show=False, legend_selectedmode='single')\n", "\n", "radar" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Scatter" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-04-23T04:43:51.698267Z", "start_time": "2019-04-23T04:43:51.691690Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on Scatter in module pyecharts.charts.scatter object:\n", "\n", "class Scatter(pyecharts.chart.Chart)\n", " | <<< 散点图 >>>\n", " | \n", " | 直角坐标系上的散点图可以用来展现数据的 x,y 之间的关系,如果数据项有多个维度,\n", " | 可以用颜色来表现,利用 geo 组件。\n", " | \n", " | Method resolution order:\n", " | Scatter\n", " | pyecharts.chart.Chart\n", " | pyecharts.base.Base\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, title='', subtitle='', **kwargs)\n", " | :param title:\n", " | 主标题文本,支持 \n", " | 换行,默认为 \"\"\n", " | :param subtitle:\n", " | 副标题文本,支持 \n", " | 换行,默认为 \"\"\n", " | :param width:\n", " | 画布宽度,默认为 800(px)\n", " | :param height:\n", " | 画布高度,默认为 400(px)\n", " | :param title_pos:\n", " | 标题距离左侧距离,默认为'left',有'auto', 'left', 'right',\n", " | 'center'可选,也可为百分比或整数\n", " | :param title_top:\n", " | 标题距离顶部距离,默认为'top',有'top', 'middle', 'bottom'可选,\n", " | 也可为百分比或整数\n", " | :param title_color:\n", " | 主标题文本颜色,默认为 '#000'\n", " | :param subtitle_color:\n", " | 副标题文本颜色,默认为 '#aaa'\n", " | :param title_text_size:\n", " | 主标题文本字体大小,默认为 18\n", " | :param subtitle_text_size:\n", " | 副标题文本字体大小,默认为 12\n", " | :param background_color:\n", " | 画布背景颜色,默认为 '#fff'\n", " | :param page_title:\n", " | 指定生成的 html 文件中 标签的值。默认为 'Echarts'\n", " | :param renderer:\n", " | 指定使用渲染方式,有 'svg' 和 'canvas' 可选,默认为 'canvas'。\n", " | 3D 图仅能使用 'canvas'。\n", " | \n", " | add(self, *args, **kwargs)\n", " | `add()` 方法只是用于提供自动参数补全\n", " | \n", " | draw(self, path, color=None)\n", " | 将图片上的像素点转换为数组,如 color 为(255,255,255)时只保留非白色像素点的\n", " | 坐标信息返回两个 k_lst, v_lst 两个列表刚好作为散点图的数据项\n", " | \n", " | :param path:\n", " | 转换图片的地址\n", " | :param color:\n", " | 所要排除的颜色\n", " | :return:\n", " | 转换后的数组\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from pyecharts.base.Base:\n", " | \n", " | get_js_dependencies(self)\n", " | 声明所有的 js 文件路径\n", " | \n", " | print_echarts_options(self)\n", " | 打印输出图形所有配置项\n", " | \n", " | render(self, path='render.html', template_name='simple_chart.html', object_name='chart', extra_context=None)\n", " | \n", " | render_embed(self)\n", " | 渲染图表的所有配置项,为 web pages 服务,不过需先提供\n", " | 所需要的js 依赖文件\n", " | \n", " | show_config(self)\n", " | 打印输出图形所有配置项\n", " | \n", " | ----------------------------------------------------------------------\n", " | Static methods inherited from pyecharts.base.Base:\n", " | \n", " | cast(seq)\n", " | 转换数据序列,将带字典和元组类型的序列转换为 k_lst,v_lst 两个列表\n", " | \n", " | 元组列表\n", " | [(A1, B1), (A2, B2), ...] -->\n", " | k_lst[ A[i1, i2...] ], v_lst[ B[i1, i2...] ]\n", " | 字典列表\n", " | [{A1: B1}, {A2: B2}, ...] -->\n", " | k_lst[ A[i1, i2...] ], v_lst[ B[i1, i2...] ]\n", " | 字典\n", " | {A1: B1, A2: B2, ...} -- >\n", " | k_lst[ A[i1, i2...] ], v_lst[ B[i1, i2...] ]\n", " | \n", " | :param seq:\n", " | 待转换的序列\n", " | :return:\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from pyecharts.base.Base:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | chart_id\n", " | \n", " | js_dependencies\n", " | \n", " | options\n", " | \n", " | page_title\n", "\n" ] } ], "source": [ "help(scatter)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-04-23T04:32:23.224359Z", "start_time": "2019-04-23T04:32:23.210591Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"667d524a1a39455e9ec778718ef4b847\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_667d524a1a39455e9ec778718ef4b847 = echarts.init(document.getElementById('667d524a1a39455e9ec778718ef4b847'), null, {renderer: 'canvas'});\n", "var option_667d524a1a39455e9ec778718ef4b847 = {\n", " \"legend\": [\n", " {\n", " \"data\": [\n", " \"A\"\n", " ],\n", " \"top\": \"top\",\n", " \"show\": true,\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"left\": \"center\",\n", " \"textStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#333\"\n", " }\n", " }\n", " ],\n", " \"series\": [\n", " {\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"data\": [\n", " [\n", " 10,\n", " 10\n", " ],\n", " [\n", " 20,\n", " 20\n", " ],\n", " [\n", " 30,\n", " 30\n", " ],\n", " [\n", " 40,\n", " 40\n", " ],\n", " [\n", " 50,\n", " 50\n", " ],\n", " [\n", " 60,\n", " 60\n", " ]\n", " ],\n", " \"label\": {\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"show\": false,\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#000\"\n", " }\n", " },\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"show\": true,\n", " \"textStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#fff\"\n", " }\n", " }\n", " },\n", " \"name\": \"A\",\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"type\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"seriesId\": 5513557,\n", " \"symbol\": \"circle\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\n", " \"yAxis\": [\n", " {\n", " \"boundaryGap\": true,\n", " \"position\": null,\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"max\": null,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"min\": null,\n", " \"inverse\": false,\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#000\"\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"formatter\": \"{value} \",\n", " \"rotate\": 0\n", " },\n", " \"nameLocation\": \"middle\",\n", " \"name\": \"\",\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"type\": \"value\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " }\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderWidth\": 0,\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " },\n", " \"formatter\": null,\n", " \"borderColor\": \"#333\",\n", " \"trigger\": \"item\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"textStyle\": {\n", " \"fontSize\": 14,\n", " \"color\": \"#fff\"\n", " }\n", " },\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"show\": true,\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"show\": true,\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"orient\": \"vertical\"\n", " },\n", " \"xAxis\": [\n", " {\n", " \"boundaryGap\": true,\n", " \"position\": null,\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"max\": null,\n", " \"data\": [\n", " 10,\n", " 20,\n", " 30,\n", " 40,\n", " 50,\n", " 60\n", " ],\n", " \"min\": null,\n", " \"inverse\": false,\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#000\"\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"nameLocation\": \"middle\",\n", " \"name\": \"\",\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"type\": \"value\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " }\n", " }\n", " ],\n", " \"series_id\": 5513557,\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", " \"#f6f5ec\"\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\",\n", " \"subtext\": \"\",\n", " \"subtextStyle\": {\n", " \"fontSize\": 12,\n", " \"color\": \"#aaa\"\n", " },\n", " \"top\": \"auto\",\n", " \"left\": \"auto\",\n", " \"textStyle\": {\n", " \"fontSize\": 18,\n", " \"color\": \"#000\"\n", " }\n", " }\n", " ]\n", "};\n", "myChart_667d524a1a39455e9ec778718ef4b847.setOption(option_667d524a1a39455e9ec778718ef4b847);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.scatter.Scatter at 0x10f418860>" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Scatter\n", "\n", "v1 = [10, 20, 30, 40, 50, 60]\n", "v2 = [10, 20, 30, 40, 50, 60]\n", "scatter = Scatter(\"散点图示例\")\n", "scatter.add(\"A\", v1, v2)\n", "#scatter.add(\"B\", v1[::-1], v2)\n", "\n", "scatter" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"b12934bf6f46466a856a00526a1544be\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_b12934bf6f46466a856a00526a1544be = echarts.init(document.getElementById('b12934bf6f46466a856a00526a1544be'), null, {renderer: 'canvas'});\n", "var option_b12934bf6f46466a856a00526a1544be = {\n", " \"series\": [\n", " {\n", " \"seriesId\": 6806247,\n", " \"data\": [\n", " [\n", " \"a\",\n", " 10\n", " ],\n", " [\n", " \"b\",\n", " 20\n", " ],\n", " [\n", " \"c\",\n", " 30\n", " ],\n", " [\n", " \"d\",\n", " 40\n", " ],\n", " [\n", " \"e\",\n", " 50\n", " ],\n", " [\n", " \"f\",\n", " 60\n", " ]\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"symbol\": \"circle\",\n", " \"type\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"name\": \"A\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " }\n", " },\n", " {\n", " \"seriesId\": 6806247,\n", " \"data\": [\n", " [\n", " \"a\",\n", " 60\n", " ],\n", " [\n", " \"b\",\n", " 50\n", " ],\n", " [\n", " \"c\",\n", " 40\n", " ],\n", " [\n", " \"d\",\n", " 30\n", " ],\n", " [\n", " \"e\",\n", " 20\n", " ],\n", " [\n", " \"f\",\n", " 10\n", " ]\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"symbol\": \"circle\",\n", " \"type\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"name\": \"B\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"A\",\n", " \"B\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\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", " \"#f6f5ec\"\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"series_id\": 6806247,\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"category\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"data\": [\n", " \"a\",\n", " \"b\",\n", " \"c\",\n", " \"d\",\n", " \"e\",\n", " \"f\"\n", " ],\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_b12934bf6f46466a856a00526a1544be.setOption(option_b12934bf6f46466a856a00526a1544be);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.scatter.Scatter at 0x10ba887b8>" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "scatter = Scatter(\"散点图示例\")\n", "scatter.add(\"A\", [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"], v2)\n", "scatter.add(\"B\", [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"], v1[::-1], xaxis_type=\"category\")\n", "\n", "scatter" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Scatter3D" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min', 'echartsgl': '/nbextensions/echarts/echarts-gl.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"c01b65a0b2cf40b49f883a31993d6a49\" style=\"width:1200px;height:600px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts', 'echartsgl'], function(echarts) {\n", " \n", "var myChart_c01b65a0b2cf40b49f883a31993d6a49 = echarts.init(document.getElementById('c01b65a0b2cf40b49f883a31993d6a49'), null, {renderer: 'canvas'});\n", "var option_c01b65a0b2cf40b49f883a31993d6a49 = {\n", " \"series\": [\n", " {\n", " \"name\": \"\",\n", " \"itemStyle\": {\n", " \"opacity\": 1\n", " },\n", " \"data\": [\n", " [\n", " 32,\n", " 54,\n", " 2\n", " ],\n", " [\n", " 54,\n", " 29,\n", " 83\n", " ],\n", " [\n", " 57,\n", " 42,\n", " 24\n", " ],\n", " [\n", " 83,\n", " 75,\n", " 28\n", " ],\n", " [\n", " 42,\n", " 32,\n", " 37\n", " ],\n", " [\n", " 34,\n", " 16,\n", " 91\n", " ],\n", " [\n", " 92,\n", " 15,\n", " 46\n", " ],\n", " [\n", " 88,\n", " 55,\n", " 50\n", " ],\n", " [\n", " 25,\n", " 87,\n", " 35\n", " ],\n", " [\n", " 93,\n", " 5,\n", " 58\n", " ],\n", " [\n", " 31,\n", " 52,\n", " 23\n", " ],\n", " [\n", " 26,\n", " 31,\n", " 68\n", " ],\n", " [\n", " 69,\n", " 65,\n", " 47\n", " ],\n", " [\n", " 84,\n", " 12,\n", " 100\n", " ],\n", " [\n", " 89,\n", " 81,\n", " 51\n", " ],\n", " [\n", " 1,\n", " 8,\n", " 74\n", " ],\n", " [\n", " 7,\n", " 75,\n", " 23\n", " ],\n", " [\n", " 27,\n", " 33,\n", " 38\n", " ],\n", " [\n", " 17,\n", " 49,\n", " 27\n", " ],\n", " [\n", " 44,\n", " 93,\n", " 68\n", " ],\n", " [\n", " 53,\n", " 87,\n", " 79\n", " ],\n", " [\n", " 13,\n", " 32,\n", " 62\n", " ],\n", " [\n", " 94,\n", " 55,\n", " 27\n", " ],\n", " [\n", " 49,\n", " 60,\n", " 27\n", " ],\n", " [\n", " 91,\n", " 8,\n", " 7\n", " ],\n", " [\n", " 64,\n", " 33,\n", " 51\n", " ],\n", " [\n", " 1,\n", " 5,\n", " 61\n", " ],\n", " [\n", " 72,\n", " 23,\n", " 11\n", " ],\n", " [\n", " 67,\n", " 78,\n", " 5\n", " ],\n", " [\n", " 27,\n", " 45,\n", " 4\n", " ],\n", " [\n", " 28,\n", " 64,\n", " 84\n", " ],\n", " [\n", " 23,\n", " 11,\n", " 84\n", " ],\n", " [\n", " 22,\n", " 43,\n", " 94\n", " ],\n", " [\n", " 86,\n", " 14,\n", " 90\n", " ],\n", " [\n", " 35,\n", " 79,\n", " 26\n", " ],\n", " [\n", " 31,\n", " 88,\n", " 75\n", " ],\n", " [\n", " 84,\n", " 99,\n", " 11\n", " ],\n", " [\n", " 91,\n", " 30,\n", " 47\n", " ],\n", " [\n", " 86,\n", " 27,\n", " 79\n", " ],\n", " [\n", " 78,\n", " 68,\n", " 65\n", " ],\n", " [\n", " 53,\n", " 61,\n", " 62\n", " ],\n", " [\n", " 5,\n", " 97,\n", " 100\n", " ],\n", " [\n", " 59,\n", " 69,\n", " 45\n", " ],\n", " [\n", " 1,\n", " 4,\n", " 8\n", " ],\n", " [\n", " 21,\n", " 77,\n", " 34\n", " ],\n", " [\n", " 82,\n", " 33,\n", " 73\n", " ],\n", " [\n", " 89,\n", " 98,\n", " 16\n", " ],\n", " [\n", " 1,\n", " 29,\n", " 12\n", " ],\n", " [\n", " 26,\n", " 20,\n", " 40\n", " ],\n", " [\n", " 35,\n", " 46,\n", " 5\n", " ],\n", " [\n", " 51,\n", " 14,\n", " 96\n", " ],\n", " [\n", " 3,\n", " 35,\n", " 4\n", " ],\n", " [\n", " 82,\n", " 97,\n", " 0\n", " ],\n", " [\n", " 92,\n", " 44,\n", " 69\n", " ],\n", " [\n", " 22,\n", " 5,\n", " 77\n", " ],\n", " [\n", " 97,\n", " 20,\n", " 93\n", " ],\n", " [\n", " 35,\n", " 68,\n", " 33\n", " ],\n", " [\n", " 32,\n", " 96,\n", " 96\n", " ],\n", " [\n", " 54,\n", " 72,\n", " 81\n", " ],\n", " [\n", " 100,\n", " 2,\n", " 9\n", " ],\n", " [\n", " 63,\n", " 75,\n", " 31\n", " ],\n", " [\n", " 34,\n", " 93,\n", " 28\n", " ],\n", " [\n", " 45,\n", " 43,\n", " 86\n", " ],\n", " [\n", " 92,\n", " 92,\n", " 29\n", " ],\n", " [\n", " 52,\n", " 1,\n", " 55\n", " ],\n", " [\n", " 84,\n", " 25,\n", " 29\n", " ],\n", " [\n", " 20,\n", " 87,\n", " 17\n", " ],\n", " [\n", " 4,\n", " 90,\n", " 51\n", " ],\n", " [\n", " 47,\n", " 69,\n", " 9\n", " ],\n", " [\n", " 100,\n", " 17,\n", " 81\n", " ],\n", " [\n", " 76,\n", " 40,\n", " 90\n", " ],\n", " [\n", " 22,\n", " 82,\n", " 1\n", " ],\n", " [\n", " 55,\n", " 100,\n", " 24\n", " ],\n", " [\n", " 79,\n", " 43,\n", " 87\n", " ],\n", " [\n", " 75,\n", " 15,\n", " 56\n", " ],\n", " [\n", " 65,\n", " 44,\n", " 40\n", " ],\n", " [\n", " 30,\n", " 85,\n", " 37\n", " ],\n", " [\n", " 40,\n", " 34,\n", " 19\n", " ],\n", " [\n", " 17,\n", " 77,\n", " 75\n", " ],\n", " [\n", " 36,\n", " 41,\n", " 17\n", " ]\n", " ],\n", " \"type\": \"scatter3D\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\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", " \"#f6f5ec\"\n", " ],\n", " \"grid3D\": {\n", " \"boxHeight\": 100,\n", " \"boxWidth\": 100,\n", " \"boxDepth\": 100,\n", " \"viewControl\": {\n", " \"autoRotate\": false,\n", " \"autoRotateSpeed\": 10,\n", " \"rotateSensitivity\": 1\n", " }\n", " },\n", " \"zAxis3D\": {\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 20,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 16\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8\n", " }\n", " },\n", " \"visualMap\": {\n", " \"calculable\": true,\n", " \"type\": \"continuous\",\n", " \"showLabel\": true,\n", " \"max\": 100,\n", " \"inRange\": {\n", " \"color\": [\n", " \"#313695\",\n", " \"#4575b4\",\n", " \"#74add1\",\n", " \"#abd9e9\",\n", " \"#e0f3f8\",\n", " \"#ffffbf\",\n", " \"#fee090\",\n", " \"#fdae61\",\n", " \"#f46d43\",\n", " \"#d73027\",\n", " \"#a50026\"\n", " ]\n", " },\n", " \"min\": 0,\n", " \"text\": [\n", " \"high\",\n", " \"low\"\n", " ],\n", " \"left\": \"left\",\n", " \"top\": \"bottom\",\n", " \"dimension\": null,\n", " \"textStyle\": {\n", " \"color\": null\n", " },\n", " \"splitNumber\": 5,\n", " \"orient\": \"vertical\"\n", " },\n", " \"xAxis3D\": {\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 20,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 16\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"interval\": \"auto\"\n", " }\n", " },\n", " \"title\": [\n", " {\n", " \"text\": \"3D \\u6563\\u70b9\\u56fe\\u793a\\u4f8b\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\n", " \"series_id\": 488285,\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"yAxis3D\": {\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 20,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 16\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"interval\": \"auto\"\n", " }\n", " },\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_c01b65a0b2cf40b49f883a31993d6a49.setOption(option_c01b65a0b2cf40b49f883a31993d6a49);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.scatter3D.Scatter3D at 0x10be1d390>" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Scatter3D\n", "\n", "import random\n", "data = [[random.randint(0, 100), random.randint(0, 100), random.randint(0, 100)] for _ in range(80)]\n", "range_color = ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf',\n", " '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']\n", "scatter3D = Scatter3D(\"3D 散点图示例\", width=1200, height=600)\n", "scatter3D.add(\"\", data, is_visualmap=True, visual_range_color=range_color)\n", "\n", "scatter3D" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# WordCloud" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min', 'wordcloud': '/nbextensions/echarts/echarts-wordcloud.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"f05445f52d164da69019db8a62a45f3c\" style=\"width:1300px;height:620px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts', 'wordcloud'], function(echarts) {\n", " \n", "var myChart_f05445f52d164da69019db8a62a45f3c = echarts.init(document.getElementById('f05445f52d164da69019db8a62a45f3c'), null, {renderer: 'canvas'});\n", "var option_f05445f52d164da69019db8a62a45f3c = {\n", " \"series\": [\n", " {\n", " \"girdSize\": 20,\n", " \"data\": [\n", " {\n", " \"name\": \"Sam S Club\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(133,52,119)\"\n", " }\n", " },\n", " \"value\": 10000\n", " },\n", " {\n", " \"name\": \"Macys\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(148,92,82)\"\n", " }\n", " },\n", " \"value\": 6181\n", " },\n", " {\n", " \"name\": \"Amy Schumer\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(28,137,77)\"\n", " }\n", " },\n", " \"value\": 4386\n", " },\n", " {\n", " \"name\": \"Jurassic World\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(150,16,156)\"\n", " }\n", " },\n", " \"value\": 4055\n", " },\n", " {\n", " \"name\": \"Charter Communications\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(70,121,157)\"\n", " }\n", " },\n", " \"value\": 2467\n", " },\n", " {\n", " \"name\": \"Chick Fil A\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(72,153,148)\"\n", " }\n", " },\n", " \"value\": 2244\n", " },\n", " {\n", " \"name\": \"Planet Fitness\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(45,57,22)\"\n", " }\n", " },\n", " \"value\": 1898\n", " },\n", " {\n", " \"name\": \"Pitch Perfect\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(8,20,152)\"\n", " }\n", " },\n", " \"value\": 1484\n", " },\n", " {\n", " \"name\": \"Express\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(56,92,92)\"\n", " }\n", " },\n", " \"value\": 1112\n", " },\n", " {\n", " \"name\": \"Home\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(113,61,44)\"\n", " }\n", " },\n", " \"value\": 965\n", " },\n", " {\n", " \"name\": \"Johnny Depp\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(87,20,153)\"\n", " }\n", " },\n", " \"value\": 847\n", " },\n", " {\n", " \"name\": \"Lena Dunham\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(21,112,29)\"\n", " }\n", " },\n", " \"value\": 582\n", " },\n", " {\n", " \"name\": \"Lewis Hamilton\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(155,44,99)\"\n", " }\n", " },\n", " \"value\": 555\n", " },\n", " {\n", " \"name\": \"KXAN\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(145,112,147)\"\n", " }\n", " },\n", " \"value\": 550\n", " },\n", " {\n", " \"name\": \"Mary Ellen Mark\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(151,119,19)\"\n", " }\n", " },\n", " \"value\": 462\n", " },\n", " {\n", " \"name\": \"Farrah Abraham\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(69,120,12)\"\n", " }\n", " },\n", " \"value\": 366\n", " },\n", " {\n", " \"name\": \"Rita Ora\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(67,101,66)\"\n", " }\n", " },\n", " \"value\": 360\n", " },\n", " {\n", " \"name\": \"Serena Williams\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(135,90,4)\"\n", " }\n", " },\n", " \"value\": 282\n", " },\n", " {\n", " \"name\": \"NCAA baseball tournament\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(4,149,53)\"\n", " }\n", " },\n", " \"value\": 273\n", " },\n", " {\n", " \"name\": \"Point Break\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(111,114,56)\"\n", " }\n", " },\n", " \"value\": 265\n", " }\n", " ],\n", " \"shape\": \"circle\",\n", " \"type\": \"wordCloud\",\n", " \"rotationRange\": [\n", " -90,\n", " 90\n", " ],\n", " \"name\": \"\",\n", " \"sizeRange\": [\n", " 20,\n", " 100\n", " ],\n", " \"rotationStep\": 45\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\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", " \"#f6f5ec\"\n", " ],\n", " \"series_id\": 7569828,\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"title\": [\n", " {\n", " \"text\": \"\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_f05445f52d164da69019db8a62a45f3c.setOption(option_f05445f52d164da69019db8a62a45f3c);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.wordcloud.WordCloud at 0x10be1d9b0>" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import WordCloud\n", "\n", "name = ['Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World', 'Charter Communications',\n", " 'Chick Fil A', 'Planet Fitness', 'Pitch Perfect', 'Express', 'Home', 'Johnny Depp',\n", " 'Lena Dunham', 'Lewis Hamilton', 'KXAN', 'Mary Ellen Mark', 'Farrah Abraham',\n", " 'Rita Ora', 'Serena Williams', 'NCAA baseball tournament', 'Point Break']\n", "value = [10000, 6181, 4386, 4055, 2467, 2244, 1898, 1484, 1112, 965, 847, 582, 555,\n", " 550, 462, 366, 360, 282, 273, 265]\n", "wordcloud = WordCloud(width=1300, height=620)\n", "wordcloud.add(\"\", name, value, word_size_range=[20, 100])\n", "\n", "wordcloud" ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min', 'wordcloud': '/nbextensions/echarts/echarts-wordcloud.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"c06d7f6007bc4082b5f3dc213a19e7dd\" style=\"width:1300px;height:620px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts', 'wordcloud'], function(echarts) {\n", " \n", "var myChart_c06d7f6007bc4082b5f3dc213a19e7dd = echarts.init(document.getElementById('c06d7f6007bc4082b5f3dc213a19e7dd'), null, {renderer: 'canvas'});\n", "var option_c06d7f6007bc4082b5f3dc213a19e7dd = {\n", " \"series\": [\n", " {\n", " \"girdSize\": 20,\n", " \"data\": [\n", " {\n", " \"name\": \"\\u53d1\\u5c55\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(81,45,16)\"\n", " }\n", " },\n", " \"value\": \"0.06303005201763046\"\n", " },\n", " {\n", " \"name\": \"\\u6539\\u9769\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(107,51,6)\"\n", " }\n", " },\n", " \"value\": \"0.05265616157230465\"\n", " },\n", " {\n", " \"name\": \"\\u63a8\\u8fdb\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(79,90,152)\"\n", " }\n", " },\n", " \"value\": \"0.052598718167672774\"\n", " },\n", " {\n", " \"name\": \"\\u5efa\\u8bbe\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(101,31,32)\"\n", " }\n", " },\n", " \"value\": \"0.03741523157587024\"\n", " },\n", " {\n", " \"name\": \"\\u52a0\\u5f3a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(132,60,118)\"\n", " }\n", " },\n", " \"value\": \"0.03400960163731312\"\n", " },\n", " {\n", " \"name\": \"\\u52a0\\u5feb\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(69,158,34)\"\n", " }\n", " },\n", " \"value\": \"0.03290422958200282\"\n", " },\n", " {\n", " \"name\": \"\\u63a8\\u52a8\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(134,77,123)\"\n", " }\n", " },\n", " \"value\": \"0.031127175540279273\"\n", " },\n", " {\n", " \"name\": \"\\u6df1\\u5316\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(51,81,62)\"\n", " }\n", " },\n", " \"value\": \"0.030234886732722142\"\n", " },\n", " {\n", " \"name\": \"\\u5b8c\\u5584\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(152,115,5)\"\n", " }\n", " },\n", " \"value\": \"0.029418670357891398\"\n", " },\n", " {\n", " \"name\": \"\\u521b\\u65b0\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(65,153,128)\"\n", " }\n", " },\n", " \"value\": \"0.02914898672361072\"\n", " },\n", " {\n", " \"name\": \"\\u5c31\\u4e1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(120,157,121)\"\n", " }\n", " },\n", " \"value\": \"0.027778343447667136\"\n", " },\n", " {\n", " \"name\": \"\\u5168\\u9762\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(2,117,4)\"\n", " }\n", " },\n", " \"value\": \"0.0277631873666079\"\n", " },\n", " {\n", " \"name\": \"\\u4fc3\\u8fdb\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(50,2,25)\"\n", " }\n", " },\n", " \"value\": \"0.02636342456599436\"\n", " },\n", " {\n", " \"name\": \"\\u7ecf\\u6d4e\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(87,143,25)\"\n", " }\n", " },\n", " \"value\": \"0.026214012726409025\"\n", " },\n", " {\n", " \"name\": \"\\u653f\\u5e9c\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(74,30,106)\"\n", " }\n", " },\n", " \"value\": \"0.02320081058853597\"\n", " },\n", " {\n", " \"name\": \"\\u6df1\\u5165\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(4,99,42)\"\n", " }\n", " },\n", " \"value\": \"0.022563621981981665\"\n", " },\n", " {\n", " \"name\": \"\\u5b9e\\u65bd\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(63,109,86)\"\n", " }\n", " },\n", " \"value\": \"0.02254817810780395\"\n", " },\n", " {\n", " \"name\": \"\\u63d0\\u9ad8\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(153,108,101)\"\n", " }\n", " },\n", " \"value\": \"0.02136726512735684\"\n", " },\n", " {\n", " \"name\": \"\\u4f01\\u4e1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(28,124,5)\"\n", " }\n", " },\n", " \"value\": \"0.0208409064137165\"\n", " },\n", " {\n", " \"name\": \"\\u652f\\u6301\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(103,94,150)\"\n", " }\n", " },\n", " \"value\": \"0.020766412042400564\"\n", " },\n", " {\n", " \"name\": \"\\u7fa4\\u4f17\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(95,109,64)\"\n", " }\n", " },\n", " \"value\": \"0.020391670040056417\"\n", " },\n", " {\n", " \"name\": \"\\u670d\\u52a1\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(28,19,147)\"\n", " }\n", " },\n", " \"value\": \"0.02034387392396192\"\n", " },\n", " {\n", " \"name\": \"\\u575a\\u6301\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(53,23,50)\"\n", " }\n", " },\n", " \"value\": \"0.019682623806973203\"\n", " },\n", " {\n", " \"name\": \"\\u4eba\\u6c11\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(119,101,101)\"\n", " }\n", " },\n", " \"value\": \"0.019103447194440057\"\n", " },\n", " {\n", " \"name\": \"\\u575a\\u51b3\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(146,48,83)\"\n", " }\n", " },\n", " \"value\": \"0.018805360993596615\"\n", " },\n", " {\n", " \"name\": \"\\u5236\\u5ea6\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(78,102,147)\"\n", " }\n", " },\n", " \"value\": \"0.01821904979058533\"\n", " },\n", " {\n", " \"name\": \"\\u6cbb\\u7406\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(135,32,115)\"\n", " }\n", " },\n", " \"value\": \"0.018018267818805358\"\n", " },\n", " {\n", " \"name\": \"\\u653f\\u7b56\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(117,2,127)\"\n", " }\n", " },\n", " \"value\": \"0.017872888354911142\"\n", " },\n", " {\n", " \"name\": \"\\u519c\\u6751\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(134,78,35)\"\n", " }\n", " },\n", " \"value\": \"0.017175470302820874\"\n", " },\n", " {\n", " \"name\": \"\\u8bd5\\u70b9\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(39,138,115)\"\n", " }\n", " },\n", " \"value\": \"0.01677049892283216\"\n", " },\n", " {\n", " \"name\": \"\\u6269\\u5927\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(10,26,103)\"\n", " }\n", " },\n", " \"value\": \"0.01655926928667419\"\n", " },\n", " {\n", " \"name\": \"\\u673a\\u5236\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(14,29,111)\"\n", " }\n", " },\n", " \"value\": \"0.016128193501692527\"\n", " },\n", " {\n", " \"name\": \"\\u793e\\u4f1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(97,56,35)\"\n", " }\n", " },\n", " \"value\": \"0.015830469466043724\"\n", " },\n", " {\n", " \"name\": \"\\u843d\\u5b9e\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(123,1,24)\"\n", " }\n", " },\n", " \"value\": \"0.015521149937128349\"\n", " },\n", " {\n", " \"name\": \"\\u5de5\\u4f5c\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(45,12,20)\"\n", " }\n", " },\n", " \"value\": \"0.015412020155303244\"\n", " },\n", " {\n", " \"name\": \"\\u4fdd\\u969c\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(96,51,159)\"\n", " }\n", " },\n", " \"value\": \"0.015380984444496475\"\n", " },\n", " {\n", " \"name\": \"\\u589e\\u957f\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(101,67,143)\"\n", " }\n", " },\n", " \"value\": \"0.014963111101551478\"\n", " },\n", " {\n", " \"name\": \"\\u56fd\\u5bb6\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(43,79,12)\"\n", " }\n", " },\n", " \"value\": \"0.014670180563633284\"\n", " },\n", " {\n", " \"name\": \"\\u751f\\u6001\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(76,89,44)\"\n", " }\n", " },\n", " \"value\": \"0.014619836003534557\"\n", " },\n", " {\n", " \"name\": \"\\u5b89\\u5168\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(135,38,18)\"\n", " }\n", " },\n", " \"value\": \"0.014078329988851904\"\n", " },\n", " {\n", " \"name\": \"\\u4eca\\u5e74\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(24,146,96)\"\n", " }\n", " },\n", " \"value\": \"0.01404747881730042\"\n", " },\n", " {\n", " \"name\": \"\\u7a33\\u5b9a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(124,130,27)\"\n", " }\n", " },\n", " \"value\": \"0.01385295973728632\"\n", " },\n", " {\n", " \"name\": \"\\u7ee7\\u7eed\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(109,147,99)\"\n", " }\n", " },\n", " \"value\": \"0.013843551613634696\"\n", " },\n", " {\n", " \"name\": \"\\u5730\\u533a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(72,61,18)\"\n", " }\n", " },\n", " \"value\": \"0.013831148120851905\"\n", " },\n", " {\n", " \"name\": \"\\u4fdd\\u62a4\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(14,27,122)\"\n", " }\n", " },\n", " \"value\": \"0.01370692198871086\"\n", " },\n", " {\n", " \"name\": \"\\u4e2d\\u56fd\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(138,145,5)\"\n", " }\n", " },\n", " \"value\": \"0.013236522043224258\"\n", " },\n", " {\n", " \"name\": \"\\u5408\\u4f5c\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(100,121,147)\"\n", " }\n", " },\n", " \"value\": \"0.013210913847843442\"\n", " },\n", " {\n", " \"name\": \"\\u4ea7\\u80fd\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(114,122,71)\"\n", " }\n", " },\n", " \"value\": \"0.013190953921248237\"\n", " },\n", " {\n", " \"name\": \"\\u7ef4\\u62a4\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(10,90,73)\"\n", " }\n", " },\n", " \"value\": \"0.013100705891509168\"\n", " },\n", " {\n", " \"name\": \"\\u91cd\\u70b9\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(1,30,6)\"\n", " }\n", " },\n", " \"value\": \"0.012594462353509167\"\n", " },\n", " {\n", " \"name\": \"\\u52a0\\u5927\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(64,77,81)\"\n", " }\n", " },\n", " \"value\": \"0.012394826322820874\"\n", " },\n", " {\n", " \"name\": \"\\u7efc\\u5408\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(50,127,36)\"\n", " }\n", " },\n", " \"value\": \"0.012325330869664315\"\n", " },\n", " {\n", " \"name\": \"\\u5f15\\u5bfc\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(155,23,7)\"\n", " }\n", " },\n", " \"value\": \"0.012314334342789847\"\n", " },\n", " {\n", " \"name\": \"\\u5f3a\\u5316\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(148,43,128)\"\n", " }\n", " },\n", " \"value\": \"0.01223011121035402\"\n", " },\n", " {\n", " \"name\": \"\\u6c11\\u751f\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(62,45,99)\"\n", " }\n", " },\n", " \"value\": \"0.012186087236834979\"\n", " },\n", " {\n", " \"name\": \"\\u4f9d\\u6cd5\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(23,52,42)\"\n", " }\n", " },\n", " \"value\": \"0.01201590062200282\"\n", " },\n", " {\n", " \"name\": \"\\u6559\\u80b2\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(36,116,22)\"\n", " }\n", " },\n", " \"value\": \"0.012013524495275037\"\n", " },\n", " {\n", " \"name\": \"\\u6211\\u4eec\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(125,106,80)\"\n", " }\n", " },\n", " \"value\": \"0.01195810284552186\"\n", " },\n", " {\n", " \"name\": \"\\u6d88\\u8d39\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(67,94,73)\"\n", " }\n", " },\n", " \"value\": \"0.011919097669235544\"\n", " },\n", " {\n", " \"name\": \"\\u6301\\u7eed\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(49,62,116)\"\n", " }\n", " },\n", " \"value\": \"0.0118487437705811\"\n", " },\n", " {\n", " \"name\": \"\\u5730\\u65b9\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(145,130,15)\"\n", " }\n", " },\n", " \"value\": \"0.011833844323310295\"\n", " },\n", " {\n", " \"name\": \"\\u521b\\u4e1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(33,4,3)\"\n", " }\n", " },\n", " \"value\": \"0.011822207396344146\"\n", " },\n", " {\n", " \"name\": \"\\u6d89\\u4f01\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(43,154,93)\"\n", " }\n", " },\n", " \"value\": \"0.011763620015796897\"\n", " },\n", " {\n", " \"name\": \"\\u6536\\u8d39\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(48,0,29)\"\n", " }\n", " },\n", " \"value\": \"0.011568689752902681\"\n", " },\n", " {\n", " \"name\": \"\\u9886\\u57df\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(39,155,47)\"\n", " }\n", " },\n", " \"value\": \"0.011450554744167842\"\n", " },\n", " {\n", " \"name\": \"\\u5347\\u7ea7\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(81,132,116)\"\n", " }\n", " },\n", " \"value\": \"0.011407331585856136\"\n", " },\n", " {\n", " \"name\": \"\\u6539\\u5584\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(18,146,128)\"\n", " }\n", " },\n", " \"value\": \"0.011313823480787025\"\n", " },\n", " {\n", " \"name\": \"\\u5b9e\\u73b0\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(92,153,107)\"\n", " }\n", " },\n", " \"value\": \"0.01121359868857969\"\n", " },\n", " {\n", " \"name\": \"\\u6709\\u6548\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(11,58,61)\"\n", " }\n", " },\n", " \"value\": \"0.01120495018148801\"\n", " },\n", " {\n", " \"name\": \"\\u4e60\\u8fd1\\u5e73\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(54,66,47)\"\n", " }\n", " },\n", " \"value\": \"0.011183857382691115\"\n", " },\n", " {\n", " \"name\": \"\\u529b\\u5ea6\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(130,71,112)\"\n", " }\n", " },\n", " \"value\": \"0.011129493729043722\"\n", " },\n", " {\n", " \"name\": \"\\u6276\\u8d2b\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(45,160,94)\"\n", " }\n", " },\n", " \"value\": \"0.011083938175537378\"\n", " },\n", " {\n", " \"name\": \"\\u8131\\u8d2b\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(0,122,7)\"\n", " }\n", " },\n", " \"value\": \"0.011050548964217206\"\n", " },\n", " {\n", " \"name\": \"\\u79ef\\u6781\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(136,75,88)\"\n", " }\n", " },\n", " \"value\": \"0.010999995590141044\"\n", " },\n", " {\n", " \"name\": \"\\u5236\\u5b9a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(123,78,49)\"\n", " }\n", " },\n", " \"value\": \"0.010857179666746122\"\n", " },\n", " {\n", " \"name\": \"\\u8865\\u77ed\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(62,73,72)\"\n", " }\n", " },\n", " \"value\": \"0.010833905808152328\"\n", " },\n", " {\n", " \"name\": \"\\u5065\\u5168\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(33,79,156)\"\n", " }\n", " },\n", " \"value\": \"0.010670836954132581\"\n", " },\n", " {\n", " \"name\": \"\\u8d28\\u91cf\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(68,75,123)\"\n", " }\n", " },\n", " \"value\": \"0.01062565405442031\"\n", " },\n", " {\n", " \"name\": \"\\u964d\\u4f4e\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(10,52,70)\"\n", " }\n", " },\n", " \"value\": \"0.01035260000148378\"\n", " },\n", " {\n", " \"name\": \"\\u4f9b\\u7ed9\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(64,160,69)\"\n", " }\n", " },\n", " \"value\": \"0.010348555639530325\"\n", " },\n", " {\n", " \"name\": \"\\u4f53\\u5236\\u6539\\u9769\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(97,9,72)\"\n", " }\n", " },\n", " \"value\": \"0.010335117475726376\"\n", " },\n", " {\n", " \"name\": \"\\u786e\\u4fdd\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(105,24,9)\"\n", " }\n", " },\n", " \"value\": \"0.010231733965047955\"\n", " },\n", " {\n", " \"name\": \"\\u7ed3\\u6784\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(160,93,15)\"\n", " }\n", " },\n", " \"value\": \"0.010220690288716501\"\n", " },\n", " {\n", " \"name\": \"\\u63d0\\u5347\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(36,46,141)\"\n", " }\n", " },\n", " \"value\": \"0.010215287910369535\"\n", " },\n", " {\n", " \"name\": \"\\u5065\\u5eb7\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(140,14,9)\"\n", " }\n", " },\n", " \"value\": \"0.01009848646280395\"\n", " },\n", " {\n", " \"name\": \"\\u8d2f\\u5f7b\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(55,128,63)\"\n", " }\n", " },\n", " \"value\": \"0.010072042061445697\"\n", " },\n", " {\n", " \"name\": \"\\u89c4\\u8303\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(127,150,54)\"\n", " }\n", " },\n", " \"value\": \"0.00997231229948378\"\n", " },\n", " {\n", " \"name\": \"\\u57ce\\u5e02\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(129,74,129)\"\n", " }\n", " },\n", " \"value\": \"0.009844721765117066\"\n", " },\n", " {\n", " \"name\": \"\\u589e\\u5f3a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(158,123,22)\"\n", " }\n", " },\n", " \"value\": \"0.009811875949658676\"\n", " },\n", " {\n", " \"name\": \"\\u519c\\u4e1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(132,70,112)\"\n", " }\n", " },\n", " \"value\": \"0.00980613894462059\"\n", " },\n", " {\n", " \"name\": \"\\u6211\\u56fd\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(0,64,22)\"\n", " }\n", " },\n", " \"value\": \"0.009746145298115655\"\n", " },\n", " {\n", " \"name\": \"\\u6218\\u7565\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(121,116,93)\"\n", " }\n", " },\n", " \"value\": \"0.009735794616186177\"\n", " },\n", " {\n", " \"name\": \"\\u7ecf\\u6d4e\\u793e\\u4f1a\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(86,48,79)\"\n", " }\n", " },\n", " \"value\": \"0.009663663163087447\"\n", " },\n", " {\n", " \"name\": \"\\u57fa\\u672c\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(16,37,34)\"\n", " }\n", " },\n", " \"value\": \"0.009480423076361072\"\n", " },\n", " {\n", " \"name\": \"\\u56fd\\u5185\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(62,130,133)\"\n", " }\n", " },\n", " \"value\": \"0.009177138594392101\"\n", " },\n", " {\n", " \"name\": \"\\u6807\\u51c6\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(131,116,53)\"\n", " }\n", " },\n", " \"value\": \"0.009160792230685472\"\n", " },\n", " {\n", " \"name\": \"\\u9f13\\u52b1\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(64,75,26)\"\n", " }\n", " },\n", " \"value\": \"0.009123816269633286\"\n", " },\n", " {\n", " \"name\": \"\\u6838\\u5fc3\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(64,6,4)\"\n", " }\n", " },\n", " \"value\": \"0.009080086608379407\"\n", " },\n", " {\n", " \"name\": \"\\u505a\\u597d\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(136,14,87)\"\n", " }\n", " },\n", " \"value\": \"0.009014587286262341\"\n", " },\n", " {\n", " \"name\": \"\\u66f4\\u52a0\",\n", " \"textStyle\": {\n", " \"normal\": {\n", " \"color\": \"rgb(109,53,2)\"\n", " }\n", " },\n", " \"value\": \"0.00898864616389845\"\n", " }\n", " ],\n", " \"shape\": \"circle\",\n", " \"type\": \"wordCloud\",\n", " \"rotationRange\": [\n", " -90,\n", " 90\n", " ],\n", " \"name\": \"\",\n", " \"sizeRange\": [\n", " 20,\n", " 100\n", " ],\n", " \"rotationStep\": 45\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\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", " \"#f6f5ec\"\n", " ],\n", " \"series_id\": 1102927,\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"title\": [\n", " {\n", " \"text\": \"\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_c06d7f6007bc4082b5f3dc213a19e7dd.setOption(option_c06d7f6007bc4082b5f3dc213a19e7dd);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.wordcloud.WordCloud at 0x11da71240>" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import jieba.analyse\n", "import numpy as np\n", "\n", "with open('../data/gov_reports1954-2017.txt', 'r') as f:\n", " reports = f.readlines()\n", "\n", "txt = reports[-1]\n", "tf = jieba.analyse.extract_tags(txt, topK=100, withWeight=True)\n", "name, value = np.array(tf).T\n", "\n", "wordcloud = WordCloud(width=1300, height=620)\n", "wordcloud.add(\"\", name, value, word_size_range=[20, 100])\n", "\n", "wordcloud" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Grid" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:07:19.481163Z", "start_time": "2018-05-06T07:07:19.472338Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Bar, Line, Scatter, EffectScatter, Grid \n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "v1 = [5, 20, 36, 10, 75, 90]\n", "v2 = [10, 25, 8, 60, 20, 80]\n", "bar = Bar(\"柱状图示例\", height=720, width=1200, title_pos=\"65%\")\n", "bar.add(\"商家A\", attr, v1, is_stack=True)\n", "bar.add(\"商家B\", attr, v2, is_stack=True, legend_pos=\"80%\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:07:20.356507Z", "start_time": "2018-05-06T07:07:20.334725Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "\n", "line = Line(\"折线图示例\")\n", "attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']\n", "line.add(\"最高气温\", attr, [11, 11, 15, 13, 12, 13, 10], mark_point=[\"max\", \"min\"], mark_line=[\"average\"])\n", "line.add(\"最低气温\", attr, [1, -2, 2, 5, 3, 2, 0], mark_point=[\"max\", \"min\"],\n", " mark_line=[\"average\"], legend_pos=\"20%\")\n", "v1 = [5, 20, 36, 10, 75, 90]\n", "v2 = [10, 25, 8, 60, 20, 80]\n", "scatter = Scatter(\"散点图示例\", title_top=\"50%\", title_pos=\"65%\")\n", "scatter.add(\"scatter\", v1, v2, legend_top=\"50%\", legend_pos=\"80%\")\n", "es = EffectScatter(\"动态散点图示例\", title_top=\"50%\")\n", "es.add(\"es\", [11, 11, 15, 13, 12, 13, 10], [1, -2, 2, 5, 3, 2, 0], effect_scale=6,\n", " legend_top=\"50%\", legend_pos=\"20%\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:07:21.523941Z", "start_time": "2018-05-06T07:07:21.508684Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"682d2e9b8bfa4e769700feffbbe2e4b1\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_682d2e9b8bfa4e769700feffbbe2e4b1 = echarts.init(document.getElementById('682d2e9b8bfa4e769700feffbbe2e4b1'), null, {renderer: 'canvas'});\n", "var option_682d2e9b8bfa4e769700feffbbe2e4b1 = {\n", " \"backgroundColor\": \"#fff\",\n", " \"yAxis\": [\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"formatter\": \"{value} \",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"nameGap\": 25,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"rotate\": 0,\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"formatter\": \"{value} \"\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 3,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"rotate\": 0,\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"formatter\": \"{value} \"\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 4,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"rotate\": 0,\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"formatter\": \"{value} \"\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 5,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"min\": null\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"subtext\": \"\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"auto\",\n", " \"left\": \"65%\",\n", " \"text\": \"\\u67f1\\u72b6\\u56fe\\u793a\\u4f8b\"\n", " },\n", " {\n", " \"subtext\": \"\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"auto\",\n", " \"left\": \"auto\",\n", " \"text\": \"\\u6298\\u7ebf\\u56fe\\u793a\\u4f8b\"\n", " },\n", " {\n", " \"subtext\": \"\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"50%\",\n", " \"left\": \"65%\",\n", " \"text\": \"\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\"\n", " },\n", " {\n", " \"subtext\": \"\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"50%\",\n", " \"left\": \"auto\",\n", " \"text\": \"\\u52a8\\u6001\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"borderColor\": \"#333\",\n", " \"trigger\": \"item\",\n", " \"borderWidth\": 0,\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " },\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null\n", " },\n", " \"toolbox\": {\n", " \"orient\": \"vertical\",\n", " \"show\": true,\n", " \"top\": \"center\",\n", " \"feature\": {\n", " \"saveAsImage\": {\n", " \"show\": true,\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n", " },\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\"\n", " },\n", " \"legend\": [\n", " {\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u5546\\u5bb6A\",\n", " \"\\u5546\\u5bb6B\"\n", " ],\n", " \"show\": true,\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"top\",\n", " \"left\": \"80%\"\n", " },\n", " {\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6700\\u9ad8\\u6c14\\u6e29\",\n", " \"\\u6700\\u4f4e\\u6c14\\u6e29\"\n", " ],\n", " \"show\": true,\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"20%\"\n", " },\n", " {\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"scatter\"\n", " ],\n", " \"show\": true,\n", " \"top\": \"50%\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"80%\"\n", " },\n", " {\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"es\"\n", " ],\n", " \"show\": true,\n", " \"top\": \"50%\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"20%\"\n", " }\n", " ],\n", " \"xAxis\": [\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"data\": [\n", " \"\\u886c\\u886b\",\n", " \"\\u7f8a\\u6bdb\\u886b\",\n", " \"\\u96ea\\u7eba\\u886b\",\n", " \"\\u88e4\\u5b50\",\n", " \"\\u9ad8\\u8ddf\\u978b\",\n", " \"\\u889c\\u5b50\"\n", " ],\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"type\": \"category\",\n", " \"position\": null,\n", " \"nameGap\": 25,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 3,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"data\": [\n", " \"\\u5468\\u4e00\",\n", " \"\\u5468\\u4e8c\",\n", " \"\\u5468\\u4e09\",\n", " \"\\u5468\\u56db\",\n", " \"\\u5468\\u4e94\",\n", " \"\\u5468\\u516d\",\n", " \"\\u5468\\u65e5\"\n", " ],\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"category\",\n", " \"position\": null,\n", " \"inverse\": false,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 4,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"data\": [\n", " 5,\n", " 20,\n", " 36,\n", " 10,\n", " 75,\n", " 90\n", " ],\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"inverse\": false,\n", " \"min\": null\n", " },\n", " {\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"name\": \"\",\n", " \"axisLabel\": {\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"margin\": 8,\n", " \"rotate\": 0\n", " },\n", " \"max\": null,\n", " \"nameLocation\": \"middle\",\n", " \"gridIndex\": 5,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"data\": null,\n", " \"show\": true,\n", " \"nameGap\": 25,\n", " \"type\": \"value\",\n", " \"position\": null,\n", " \"inverse\": false,\n", " \"min\": null\n", " }\n", " ],\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", " \"#f6f5ec\"\n", " ],\n", " \"series\": [\n", " {\n", " \"name\": \"\\u5546\\u5bb6A\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"data\": [\n", " 5,\n", " 20,\n", " 36,\n", " 10,\n", " 75,\n", " 90\n", " ],\n", " \"xAxisIndex\": 0,\n", " \"stack\": \"stack_3944099\",\n", " \"barCategoryGap\": \"20%\",\n", " \"type\": \"bar\",\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3944099,\n", " \"yAxisIndex\": 0\n", " },\n", " {\n", " \"name\": \"\\u5546\\u5bb6B\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"data\": [\n", " 10,\n", " 25,\n", " 8,\n", " 60,\n", " 20,\n", " 80\n", " ],\n", " \"xAxisIndex\": 0,\n", " \"stack\": \"stack_3944099\",\n", " \"barCategoryGap\": \"20%\",\n", " \"type\": \"bar\",\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3944099,\n", " \"yAxisIndex\": 0\n", " },\n", " {\n", " \"markLine\": {\n", " \"data\": [\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"mean-Value\",\n", " \"type\": \"average\"\n", " }\n", " ],\n", " \"symbolSize\": 10\n", " },\n", " \"name\": \"\\u6700\\u9ad8\\u6c14\\u6e29\",\n", " \"areaStyle\": {\n", " \"opacity\": 0,\n", " \"color\": null\n", " },\n", " \"symbolSize\": 4,\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"symbol\": \"emptyCircle\",\n", " \"yAxisIndex\": 1,\n", " \"data\": [\n", " 11,\n", " 11,\n", " 15,\n", " 13,\n", " 12,\n", " 13,\n", " 10\n", " ],\n", " \"lineStyle\": {\n", " \"normal\": {\n", " \"width\": 1,\n", " \"opacity\": 1,\n", " \"color\": null,\n", " \"type\": \"solid\",\n", " \"curveness\": 0\n", " }\n", " },\n", " \"stack\": \"\",\n", " \"type\": \"line\",\n", " \"markPoint\": {\n", " \"data\": [\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"Maximum\",\n", " \"type\": \"max\",\n", " \"symbolSize\": 50,\n", " \"label\": {\n", " \"normal\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\"\n", " }\n", " }\n", " },\n", " \"symbol\": \"pin\"\n", " },\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"Minimum\",\n", " \"type\": \"min\",\n", " \"symbolSize\": 50,\n", " \"label\": {\n", " \"normal\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\"\n", " }\n", " }\n", " },\n", " \"symbol\": \"pin\"\n", " }\n", " ]\n", " },\n", " \"xAxisIndex\": 1,\n", " \"step\": false,\n", " \"seriesId\": 5272637,\n", " \"showSymbol\": true,\n", " \"smooth\": false\n", " },\n", " {\n", " \"markLine\": {\n", " \"data\": [\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"mean-Value\",\n", " \"type\": \"average\"\n", " }\n", " ],\n", " \"symbolSize\": 10\n", " },\n", " \"name\": \"\\u6700\\u4f4e\\u6c14\\u6e29\",\n", " \"areaStyle\": {\n", " \"opacity\": 0,\n", " \"color\": null\n", " },\n", " \"symbolSize\": 4,\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"symbol\": \"emptyCircle\",\n", " \"yAxisIndex\": 1,\n", " \"data\": [\n", " 1,\n", " -2,\n", " 2,\n", " 5,\n", " 3,\n", " 2,\n", " 0\n", " ],\n", " \"lineStyle\": {\n", " \"normal\": {\n", " \"width\": 1,\n", " \"opacity\": 1,\n", " \"color\": null,\n", " \"type\": \"solid\",\n", " \"curveness\": 0\n", " }\n", " },\n", " \"stack\": \"\",\n", " \"type\": \"line\",\n", " \"markPoint\": {\n", " \"data\": [\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"Maximum\",\n", " \"type\": \"max\",\n", " \"symbolSize\": 50,\n", " \"label\": {\n", " \"normal\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\"\n", " }\n", " }\n", " },\n", " \"symbol\": \"pin\"\n", " },\n", " {\n", " \"valueDim\": null,\n", " \"name\": \"Minimum\",\n", " \"type\": \"min\",\n", " \"symbolSize\": 50,\n", " \"label\": {\n", " \"normal\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\"\n", " }\n", " }\n", " },\n", " \"symbol\": \"pin\"\n", " }\n", " ]\n", " },\n", " \"xAxisIndex\": 1,\n", " \"step\": false,\n", " \"seriesId\": 5272637,\n", " \"showSymbol\": true,\n", " \"smooth\": false\n", " },\n", " {\n", " \"name\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"type\": \"scatter\",\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"symbol\": \"circle\",\n", " \"data\": [\n", " [\n", " 5,\n", " 10\n", " ],\n", " [\n", " 20,\n", " 25\n", " ],\n", " [\n", " 36,\n", " 8\n", " ],\n", " [\n", " 10,\n", " 60\n", " ],\n", " [\n", " 75,\n", " 20\n", " ],\n", " [\n", " 90,\n", " 80\n", " ]\n", " ],\n", " \"xAxisIndex\": 2,\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 7664599,\n", " \"yAxisIndex\": 2\n", " },\n", " {\n", " \"yAxisIndex\": 3,\n", " \"name\": \"es\",\n", " \"xAxisIndex\": 3,\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": false,\n", " \"formatter\": null\n", " }\n", " },\n", " \"type\": \"effectScatter\",\n", " \"seriesId\": 6322629,\n", " \"data\": [\n", " [\n", " 11,\n", " 1\n", " ],\n", " [\n", " 11,\n", " -2\n", " ],\n", " [\n", " 15,\n", " 2\n", " ],\n", " [\n", " 13,\n", " 5\n", " ],\n", " [\n", " 12,\n", " 3\n", " ],\n", " [\n", " 13,\n", " 2\n", " ],\n", " [\n", " 10,\n", " 0\n", " ]\n", " ],\n", " \"showEffectOn\": \"render\",\n", " \"symbolSize\": 10,\n", " \"rippleEffect\": {\n", " \"period\": 4,\n", " \"scale\": 6,\n", " \"brushType\": \"stroke\"\n", " },\n", " \"symbol\": \"circle\"\n", " }\n", " ],\n", " \"grid\": [\n", " {\n", " \"bottom\": \"60%\",\n", " \"left\": \"60%\"\n", " },\n", " {\n", " \"bottom\": \"60%\",\n", " \"left\": \"60%\"\n", " },\n", " {\n", " \"right\": \"60%\",\n", " \"bottom\": \"60%\"\n", " },\n", " {\n", " \"right\": \"60%\",\n", " \"bottom\": \"60%\"\n", " },\n", " {\n", " \"top\": \"60%\",\n", " \"left\": \"60%\"\n", " },\n", " {\n", " \"right\": \"60%\",\n", " \"top\": \"60%\"\n", " }\n", " ],\n", " \"series_id\": 3944099\n", "};\n", "myChart_682d2e9b8bfa4e769700feffbbe2e4b1.setOption(option_682d2e9b8bfa4e769700feffbbe2e4b1);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.custom.grid.Grid at 0x1109d9780>" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid = Grid()\n", "grid.add(bar, grid_bottom=\"60%\", grid_left=\"60%\")\n", "grid.add(line, grid_bottom=\"60%\", grid_right=\"60%\")\n", "grid.add(scatter, grid_top=\"60%\", grid_left=\"60%\")\n", "grid.add(es, grid_top=\"60%\", grid_right=\"60%\")\n", "\n", "grid" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Save html files" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:08:02.417679Z", "start_time": "2018-05-06T07:08:02.406827Z" }, "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "grid.render(path = 'grid.html')\n", "#help(grid.render)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Overlap" ] }, { "cell_type": "code", "execution_count": 120, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"522380e31e284c33b64b6eb6fb73beb2\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_522380e31e284c33b64b6eb6fb73beb2 = echarts.init(document.getElementById('522380e31e284c33b64b6eb6fb73beb2'), null, {renderer: 'canvas'});\n", "var option_522380e31e284c33b64b6eb6fb73beb2 = {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 10,\n", " 20,\n", " 30,\n", " 40,\n", " 50,\n", " 60\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"bar\",\n", " \"barCategoryGap\": \"20%\",\n", " \"seriesId\": 2508144,\n", " \"label\": {\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": null,\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 38,\n", " 28,\n", " 58,\n", " 48,\n", " 78,\n", " 68\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"type\": \"line\",\n", " \"lineStyle\": {\n", " \"normal\": {\n", " \"width\": 1,\n", " \"opacity\": 1,\n", " \"type\": \"solid\",\n", " \"curveness\": 0,\n", " \"color\": null\n", " }\n", " },\n", " \"symbolSize\": 4,\n", " \"stack\": \"\",\n", " \"name\": \"line\",\n", " \"yAxisIndex\": 0,\n", " \"smooth\": false,\n", " \"areaStyle\": {\n", " \"color\": null,\n", " \"opacity\": 0\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"symbol\": \"emptyCircle\",\n", " \"step\": false,\n", " \"xAxisIndex\": 0,\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"seriesId\": 2508144,\n", " \"showSymbol\": true\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"bar\",\n", " \"line\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\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", " \"#f6f5ec\"\n", " ],\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"position\": null,\n", " \"inverse\": false,\n", " \"show\": true,\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"type\": \"value\",\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"position\": null,\n", " \"type\": \"category\",\n", " \"show\": true,\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"inverse\": false,\n", " \"data\": [\n", " \"A\",\n", " \"B\",\n", " \"C\",\n", " \"D\",\n", " \"E\",\n", " \"F\"\n", " ],\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"toolbox\": {\n", " \"orient\": \"vertical\",\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " }\n", " },\n", " \"series_id\": 2508144,\n", " \"title\": [\n", " {\n", " \"text\": \"Line - Bar \\u793a\\u4f8b\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_522380e31e284c33b64b6eb6fb73beb2.setOption(option_522380e31e284c33b64b6eb6fb73beb2);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.custom.overlap.Overlap at 0x11daaa6a0>" ] }, "execution_count": 120, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Bar, Line, Overlap\n", "\n", "attr = ['A', 'B', 'C', 'D', 'E', 'F']\n", "v1 = [10, 20, 30, 40, 50, 60]\n", "v2 = [38, 28, 58, 48, 78, 68]\n", "bar = Bar(\"Line - Bar 示例\")\n", "bar.add(\"bar\", attr, v1)\n", "line = Line()\n", "line.add(\"line\", attr, v2)\n", "\n", "overlap = Overlap()\n", "overlap.add(bar)\n", "overlap.add(line)\n", "\n", "overlap" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Page" ] }, { "cell_type": "code", "execution_count": 129, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Page, Scatter, EffectScatter\n", "page = Page()\n", "v1 = [10, 20, 30, 40, 50, 60]\n", "v2 = [10, 20, 30, 40, 50, 60]\n", "scatter = Scatter(\"散点图示例\")\n", "scatter.add(\"A\", v1, v2)\n", "scatter.add(\"B\", v1[::-1], v2)\n", "\n", "page.add(scatter)\n", "\n", "es = EffectScatter(\"动态散点图示例\", title_top=\"50%\")\n", "es.add(\"es\", [11, 11, 15, 13, 12, 13, 10], [1, -2, 2, 5, 3, 2, 0], effect_scale=6,\n", " legend_top=\"50%\", legend_pos=\"20%\")\n", "page.add(es)" ] }, { "cell_type": "code", "execution_count": 130, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"2d999879ab624a5cb551a29f8c388224\" style=\"width:800px;height:400px;\"></div>\n", " <div id=\"9a3c907996744ba5b11e66ceaa8c9282\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_2d999879ab624a5cb551a29f8c388224 = echarts.init(document.getElementById('2d999879ab624a5cb551a29f8c388224'), null, {renderer: 'canvas'});\n", "var option_2d999879ab624a5cb551a29f8c388224 = {\n", " \"series\": [\n", " {\n", " \"seriesId\": 341224,\n", " \"data\": [\n", " [\n", " 10,\n", " 10\n", " ],\n", " [\n", " 20,\n", " 20\n", " ],\n", " [\n", " 30,\n", " 30\n", " ],\n", " [\n", " 40,\n", " 40\n", " ],\n", " [\n", " 50,\n", " 50\n", " ],\n", " [\n", " 60,\n", " 60\n", " ]\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"symbol\": \"circle\",\n", " \"type\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"name\": \"A\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " }\n", " },\n", " {\n", " \"seriesId\": 341224,\n", " \"data\": [\n", " [\n", " 60,\n", " 10\n", " ],\n", " [\n", " 50,\n", " 20\n", " ],\n", " [\n", " 40,\n", " 30\n", " ],\n", " [\n", " 30,\n", " 40\n", " ],\n", " [\n", " 20,\n", " 50\n", " ],\n", " [\n", " 10,\n", " 60\n", " ]\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"symbol\": \"circle\",\n", " \"type\": \"scatter\",\n", " \"symbolSize\": 10,\n", " \"name\": \"B\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"A\",\n", " \"B\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\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", " \"#f6f5ec\"\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"series_id\": 341224,\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"data\": [\n", " 60,\n", " 50,\n", " 40,\n", " 30,\n", " 20,\n", " 10\n", " ],\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_2d999879ab624a5cb551a29f8c388224.setOption(option_2d999879ab624a5cb551a29f8c388224);\n", "\n", "\n", "var myChart_9a3c907996744ba5b11e66ceaa8c9282 = echarts.init(document.getElementById('9a3c907996744ba5b11e66ceaa8c9282'), null, {renderer: 'canvas'});\n", "var option_9a3c907996744ba5b11e66ceaa8c9282 = {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " [\n", " 11,\n", " 1\n", " ],\n", " [\n", " 11,\n", " -2\n", " ],\n", " [\n", " 15,\n", " 2\n", " ],\n", " [\n", " 13,\n", " 5\n", " ],\n", " [\n", " 12,\n", " 3\n", " ],\n", " [\n", " 13,\n", " 2\n", " ],\n", " [\n", " 10,\n", " 0\n", " ]\n", " ],\n", " \"symbol\": \"circle\",\n", " \"type\": \"effectScatter\",\n", " \"symbolSize\": 10,\n", " \"name\": \"es\",\n", " \"showEffectOn\": \"render\",\n", " \"rippleEffect\": {\n", " \"brushType\": \"stroke\",\n", " \"period\": 4,\n", " \"scale\": 6\n", " },\n", " \"seriesId\": 1666237,\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"es\"\n", " ],\n", " \"left\": \"20%\",\n", " \"top\": \"50%\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\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", " \"#f6f5ec\"\n", " ],\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"series_id\": 1666237,\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"data\": null,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"title\": [\n", " {\n", " \"text\": \"\\u52a8\\u6001\\u6563\\u70b9\\u56fe\\u793a\\u4f8b\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"50%\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_9a3c907996744ba5b11e66ceaa8c9282.setOption(option_9a3c907996744ba5b11e66ceaa8c9282);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "[<pyecharts.charts.scatter.Scatter at 0x11da80240>,\n", " <pyecharts.charts.effectscatter.EffectScatter at 0x11da80748>]" ] }, "execution_count": 130, "metadata": {}, "output_type": "execute_result" } ], "source": [ "page" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Timeline" ] }, { "cell_type": "code", "execution_count": 124, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from pyecharts import Bar, Timeline\n", "\n", "from random import randint\n", "\n", "attr = [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n", "bar_1 = Bar(\"2012 年销量\", \"数据纯属虚构\")\n", "bar_1.add(\"春季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_1.add(\"夏季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_1.add(\"秋季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_1.add(\"冬季\", attr, [randint(10, 100) for _ in range(6)])\n" ] }, { "cell_type": "code", "execution_count": 125, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "bar_2 = Bar(\"2013 年销量\", \"数据纯属虚构\")\n", "bar_2.add(\"春季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_2.add(\"夏季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_2.add(\"秋季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_2.add(\"冬季\", attr, [randint(10, 100) for _ in range(6)])\n", "\n", "bar_3 = Bar(\"2014 年销量\", \"数据纯属虚构\")\n", "bar_3.add(\"春季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_3.add(\"夏季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_3.add(\"秋季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_3.add(\"冬季\", attr, [randint(10, 100) for _ in range(6)])" ] }, { "cell_type": "code", "execution_count": 127, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "bar_4 = Bar(\"2015 年销量\", \"数据纯属虚构\")\n", "bar_4.add(\"春季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_4.add(\"夏季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_4.add(\"秋季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_4.add(\"冬季\", attr, [randint(10, 100) for _ in range(6)])\n", "\n", "bar_5 = Bar(\"2016 年销量\", \"数据纯属虚构\")\n", "bar_5.add(\"春季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_5.add(\"夏季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_5.add(\"秋季\", attr, [randint(10, 100) for _ in range(6)])\n", "bar_5.add(\"冬季\", attr, [randint(10, 100) for _ in range(6)], is_legend_show=True)\n" ] }, { "cell_type": "code", "execution_count": 128, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"6597b138045a4ff491c38698392d0bb9\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_6597b138045a4ff491c38698392d0bb9 = echarts.init(document.getElementById('6597b138045a4ff491c38698392d0bb9'), null, {renderer: 'canvas'});\n", "var option_6597b138045a4ff491c38698392d0bb9 = {\n", " \"baseOption\": {\n", " \"series\": [],\n", " \"backgroundColor\": \"#fff\",\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"category\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"data\": [\n", " \"\\u886c\\u886b\",\n", " \"\\u7f8a\\u6bdb\\u886b\",\n", " \"\\u96ea\\u7eba\\u886b\",\n", " \"\\u88e4\\u5b50\",\n", " \"\\u9ad8\\u8ddf\\u978b\",\n", " \"\\u889c\\u5b50\"\n", " ],\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"timeline\": {\n", " \"bottom\": 0,\n", " \"data\": [\n", " \"2012 \\u5e74\",\n", " \"2013 \\u5e74\",\n", " \"2014 \\u5e74\",\n", " \"2015 \\u5e74\",\n", " \"2016 \\u5e74\"\n", " ],\n", " \"autoPlay\": true,\n", " \"symbolSize\": 10,\n", " \"right\": \"auto\",\n", " \"show\": true,\n", " \"axisType\": \"category\",\n", " \"loop\": true,\n", " \"rewind\": false,\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"symbol\": \"emptyCircle\",\n", " \"playInterval\": 2000\n", " }\n", " },\n", " \"options\": [\n", " {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 34,\n", " 94,\n", " 95,\n", " 66,\n", " 64,\n", " 96\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1333430,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u6625\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 31,\n", " 57,\n", " 44,\n", " 59,\n", " 25,\n", " 93\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1333430,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u590f\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 55,\n", " 64,\n", " 56,\n", " 74,\n", " 83,\n", " 22\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1333430,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u79cb\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 33,\n", " 72,\n", " 60,\n", " 100,\n", " 59,\n", " 22\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1333430,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u51ac\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6625\\u5b63\",\n", " \"\\u590f\\u5b63\",\n", " \"\\u79cb\\u5b63\",\n", " \"\\u51ac\\u5b63\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"2012 \\u5e74\\u9500\\u91cf\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\\u6570\\u636e\\u7eaf\\u5c5e\\u865a\\u6784\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", " },\n", " {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 31,\n", " 37,\n", " 47,\n", " 28,\n", " 86,\n", " 16\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1924215,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u6625\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 89,\n", " 61,\n", " 29,\n", " 64,\n", " 59,\n", " 27\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1924215,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u590f\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 24,\n", " 32,\n", " 17,\n", " 65,\n", " 68,\n", " 77\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1924215,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u79cb\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 50,\n", " 28,\n", " 27,\n", " 34,\n", " 61,\n", " 56\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 1924215,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u51ac\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6625\\u5b63\",\n", " \"\\u590f\\u5b63\",\n", " \"\\u79cb\\u5b63\",\n", " \"\\u51ac\\u5b63\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"2013 \\u5e74\\u9500\\u91cf\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\\u6570\\u636e\\u7eaf\\u5c5e\\u865a\\u6784\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", " },\n", " {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 96,\n", " 49,\n", " 46,\n", " 45,\n", " 62,\n", " 27\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3306251,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u6625\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 20,\n", " 42,\n", " 40,\n", " 51,\n", " 88,\n", " 89\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3306251,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u590f\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 69,\n", " 59,\n", " 14,\n", " 11,\n", " 77,\n", " 45\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3306251,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u79cb\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 20,\n", " 23,\n", " 61,\n", " 12,\n", " 87,\n", " 30\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 3306251,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u51ac\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6625\\u5b63\",\n", " \"\\u590f\\u5b63\",\n", " \"\\u79cb\\u5b63\",\n", " \"\\u51ac\\u5b63\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"2014 \\u5e74\\u9500\\u91cf\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\\u6570\\u636e\\u7eaf\\u5c5e\\u865a\\u6784\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", " },\n", " {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 22,\n", " 31,\n", " 92,\n", " 25,\n", " 16,\n", " 84\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 6342299,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u6625\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 11,\n", " 34,\n", " 37,\n", " 37,\n", " 90,\n", " 54\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 6342299,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u590f\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 92,\n", " 18,\n", " 11,\n", " 83,\n", " 26,\n", " 37\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 6342299,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u79cb\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 26,\n", " 36,\n", " 65,\n", " 68,\n", " 79,\n", " 75\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 6342299,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u51ac\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6625\\u5b63\",\n", " \"\\u590f\\u5b63\",\n", " \"\\u79cb\\u5b63\",\n", " \"\\u51ac\\u5b63\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"2015 \\u5e74\\u9500\\u91cf\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\\u6570\\u636e\\u7eaf\\u5c5e\\u865a\\u6784\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", " },\n", " {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " 28,\n", " 68,\n", " 44,\n", " 86,\n", " 15,\n", " 51\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 2331890,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u6625\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 93,\n", " 91,\n", " 61,\n", " 60,\n", " 64,\n", " 59\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 2331890,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u590f\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 92,\n", " 19,\n", " 17,\n", " 48,\n", " 73,\n", " 37\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 2331890,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u79cb\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " },\n", " {\n", " \"data\": [\n", " 22,\n", " 50,\n", " 98,\n", " 73,\n", " 17,\n", " 80\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 2331890,\n", " \"type\": \"bar\",\n", " \"stack\": \"\",\n", " \"name\": \"\\u51ac\\u5b63\",\n", " \"barCategoryGap\": \"20%\",\n", " \"markLine\": {\n", " \"data\": []\n", " },\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"\\u6625\\u5b63\",\n", " \"\\u590f\\u5b63\",\n", " \"\\u79cb\\u5b63\",\n", " \"\\u51ac\\u5b63\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"text\": \"2016 \\u5e74\\u9500\\u91cf\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\\u6570\\u636e\\u7eaf\\u5c5e\\u865a\\u6784\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", " }\n", " ]\n", "};\n", "myChart_6597b138045a4ff491c38698392d0bb9.setOption(option_6597b138045a4ff491c38698392d0bb9);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.custom.timeline.Timeline at 0x11da15550>" ] }, "execution_count": 128, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\n", "timeline = Timeline(is_auto_play=True, timeline_bottom=0)\n", "timeline.add(bar_1, '2012 年')\n", "timeline.add(bar_2, '2013 年')\n", "timeline.add(bar_3, '2014 年')\n", "timeline.add(bar_4, '2015 年')\n", "timeline.add(bar_5, '2016 年')\n", "\n", "timeline" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# More \n", "https://github.com/pyecharts/pyecharts/tree/master/test" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2018-05-06T07:06:18.250815Z", "start_time": "2018-05-06T07:06:18.200263Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"848b9d701f75406daf46752f1e104482\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_848b9d701f75406daf46752f1e104482 = echarts.init(document.getElementById('848b9d701f75406daf46752f1e104482'), null, {renderer: 'canvas'});\n", "var option_848b9d701f75406daf46752f1e104482 = {\n", " \"series_id\": 8805229,\n", " \"backgroundColor\": \"#fff\",\n", " \"singleAxis\": {\n", " \"type\": \"time\"\n", " },\n", " \"tooltip\": {\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"borderColor\": \"#333\",\n", " \"trigger\": \"axis\",\n", " \"borderWidth\": 0,\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " },\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null\n", " },\n", " \"toolbox\": {\n", " \"orient\": \"vertical\",\n", " \"feature\": {\n", " \"saveAsImage\": {\n", " \"show\": true,\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n", " },\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"left\": \"95%\"\n", " },\n", " \"legend\": [\n", " {\n", " \"orient\": \"horizontal\",\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"DQ\",\n", " \"TY\",\n", " \"SS\",\n", " \"QG\",\n", " \"SY\",\n", " \"DD\"\n", " ],\n", " \"show\": true,\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"center\"\n", " }\n", " ],\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", " \"#f6f5ec\"\n", " ],\n", " \"series\": [\n", " {\n", " \"seriesId\": 8805229,\n", " \"data\": [\n", " [\n", " \"2015/11/08\",\n", " 10,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/09\",\n", " 15,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/10\",\n", " 35,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/14\",\n", " 7,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/15\",\n", " 2,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/16\",\n", " 17,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/17\",\n", " 33,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/18\",\n", " 40,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/19\",\n", " 32,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/20\",\n", " 26,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/21\",\n", " 35,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/22\",\n", " 40,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/23\",\n", " 32,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/24\",\n", " 26,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/25\",\n", " 22,\n", " \"DQ\"\n", " ],\n", " [\n", " \"2015/11/08\",\n", " 35,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/09\",\n", " 36,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/10\",\n", " 37,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/11\",\n", " 22,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/12\",\n", " 24,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/13\",\n", " 26,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/14\",\n", " 34,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/15\",\n", " 21,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/16\",\n", " 18,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/17\",\n", " 45,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/18\",\n", " 32,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/19\",\n", " 35,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/20\",\n", " 30,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/21\",\n", " 28,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/22\",\n", " 27,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/23\",\n", " 26,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/24\",\n", " 15,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/25\",\n", " 30,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/26\",\n", " 35,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/27\",\n", " 42,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/28\",\n", " 42,\n", " \"TY\"\n", " ],\n", " [\n", " \"2015/11/08\",\n", " 21,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/09\",\n", " 25,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/10\",\n", " 27,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/11\",\n", " 23,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/12\",\n", " 24,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/13\",\n", " 21,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/14\",\n", " 35,\n", " \"SS\"\n", " ],\n", " [\n", " \"2015/11/15\",\n", " 39,\n", " \"SS\"\n", " ]\n", " ],\n", " \"name\": [\n", " \"DQ\",\n", " \"TY\",\n", " \"SS\",\n", " \"QG\",\n", " \"SY\",\n", " \"DD\"\n", " ],\n", " \"label\": {\n", " \"emphasis\": {\n", " \"position\": null,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true\n", " },\n", " \"normal\": {\n", " \"position\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"formatter\": null\n", " }\n", " },\n", " \"type\": \"themeRiver\"\n", " }\n", " ],\n", " \"title\": [\n", " {\n", " \"subtext\": \"\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"top\": \"auto\",\n", " \"left\": \"auto\",\n", " \"text\": \"\\u4e3b\\u9898\\u6cb3\\u6d41\\u56fe\\u793a\\u4f8b\\u56fe\"\n", " }\n", " ]\n", "};\n", "myChart_848b9d701f75406daf46752f1e104482.setOption(option_848b9d701f75406daf46752f1e104482);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.themeriver.ThemeRiver at 0x1109f7128>" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import ThemeRiver\n", "\n", "data = [\n", " ['2015/11/08', 10, 'DQ'], ['2015/11/09', 15, 'DQ'],\n", " ['2015/11/10', 35, 'DQ'], ['2015/11/14', 7, 'DQ'],\n", " ['2015/11/15', 2, 'DQ'], ['2015/11/16', 17, 'DQ'],\n", " ['2015/11/17', 33, 'DQ'], ['2015/11/18', 40, 'DQ'],\n", " ['2015/11/19', 32, 'DQ'], ['2015/11/20', 26, 'DQ'],\n", " ['2015/11/21', 35, 'DQ'], ['2015/11/22', 40, 'DQ'],\n", " ['2015/11/23', 32, 'DQ'], ['2015/11/24', 26, 'DQ'],\n", " ['2015/11/25', 22, 'DQ'], ['2015/11/08', 35, 'TY'],\n", " ['2015/11/09', 36, 'TY'], ['2015/11/10', 37, 'TY'],\n", " ['2015/11/11', 22, 'TY'], ['2015/11/12', 24, 'TY'],\n", " ['2015/11/13', 26, 'TY'], ['2015/11/14', 34, 'TY'],\n", " ['2015/11/15', 21, 'TY'], ['2015/11/16', 18, 'TY'],\n", " ['2015/11/17', 45, 'TY'], ['2015/11/18', 32, 'TY'],\n", " ['2015/11/19', 35, 'TY'], ['2015/11/20', 30, 'TY'],\n", " ['2015/11/21', 28, 'TY'], ['2015/11/22', 27, 'TY'],\n", " ['2015/11/23', 26, 'TY'], ['2015/11/24', 15, 'TY'],\n", " ['2015/11/25', 30, 'TY'], ['2015/11/26', 35, 'TY'],\n", " ['2015/11/27', 42, 'TY'], ['2015/11/28', 42, 'TY'],\n", " ['2015/11/08', 21, 'SS'], ['2015/11/09', 25, 'SS'],\n", " ['2015/11/10', 27, 'SS'], ['2015/11/11', 23, 'SS'],\n", " ['2015/11/12', 24, 'SS'], ['2015/11/13', 21, 'SS'],\n", " ['2015/11/14', 35, 'SS'], ['2015/11/15', 39, 'SS']\n", "]\n", "tr = ThemeRiver(\"主题河流图示例图\")\n", "tr.add(['DQ', 'TY', 'SS', 'QG', 'SY', 'DD'], data, is_label_show=True)\n", "tr" ] }, { "cell_type": "code", "execution_count": 163, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "<script>\n", " require.config({\n", " paths: {\n", " 'echarts': '/nbextensions/echarts/echarts.min'\n", " }\n", " });\n", "</script>\n", " <div id=\"f77d41c1899341f2891324502cb782c6\" style=\"width:800px;height:400px;\"></div>\n", "\n", "\n", "<script>\n", " require(['echarts'], function(echarts) {\n", " \n", "var myChart_f77d41c1899341f2891324502cb782c6 = echarts.init(document.getElementById('f77d41c1899341f2891324502cb782c6'), null, {renderer: 'canvas'});\n", "var option_f77d41c1899341f2891324502cb782c6 = {\n", " \"series\": [\n", " {\n", " \"data\": [\n", " [\n", " 650,\n", " 850.0,\n", " 940.0,\n", " 980.0,\n", " 1070\n", " ],\n", " [\n", " 760,\n", " 800.0,\n", " 845.0,\n", " 895.0,\n", " 960\n", " ],\n", " [\n", " 620,\n", " 840.0,\n", " 855.0,\n", " 880.0,\n", " 970\n", " ],\n", " [\n", " 720,\n", " 762.5,\n", " 815.0,\n", " 875.0,\n", " 920\n", " ],\n", " [\n", " 740,\n", " 802.5,\n", " 810.0,\n", " 870.0,\n", " 950\n", " ]\n", " ],\n", " \"markPoint\": {\n", " \"data\": []\n", " },\n", " \"seriesId\": 2321674,\n", " \"type\": \"boxplot\",\n", " \"name\": \"boxplot\",\n", " \"label\": {\n", " \"normal\": {\n", " \"formatter\": null,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": \"top\",\n", " \"show\": false\n", " },\n", " \"emphasis\": {\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 12\n", " },\n", " \"position\": null,\n", " \"show\": true\n", " }\n", " },\n", " \"markLine\": {\n", " \"data\": []\n", " }\n", " }\n", " ],\n", " \"legend\": [\n", " {\n", " \"selectedMode\": \"multiple\",\n", " \"data\": [\n", " \"boxplot\"\n", " ],\n", " \"left\": \"center\",\n", " \"top\": \"top\",\n", " \"textStyle\": {\n", " \"color\": \"#333\",\n", " \"fontSize\": 12\n", " },\n", " \"show\": true,\n", " \"orient\": \"horizontal\"\n", " }\n", " ],\n", " \"backgroundColor\": \"#fff\",\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", " \"#f6f5ec\"\n", " ],\n", " \"yAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"value\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"splitLine\": {\n", " \"show\": true\n", " },\n", " \"inverse\": false,\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"formatter\": \"{value} \",\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"series_id\": 2321674,\n", " \"xAxis\": [\n", " {\n", " \"nameLocation\": \"middle\",\n", " \"axisTick\": {\n", " \"alignWithLabel\": false\n", " },\n", " \"position\": null,\n", " \"type\": \"category\",\n", " \"max\": null,\n", " \"name\": \"\",\n", " \"min\": null,\n", " \"nameGap\": 25,\n", " \"boundaryGap\": true,\n", " \"show\": true,\n", " \"inverse\": false,\n", " \"data\": [\n", " \"expr1\",\n", " \"expr2\",\n", " \"expr3\",\n", " \"expr4\",\n", " \"expr5\"\n", " ],\n", " \"nameTextStyle\": {\n", " \"fontSize\": 14\n", " },\n", " \"axisLabel\": {\n", " \"margin\": 8,\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 12\n", " },\n", " \"interval\": \"auto\",\n", " \"rotate\": 0\n", " }\n", " }\n", " ],\n", " \"toolbox\": {\n", " \"feature\": {\n", " \"dataView\": {\n", " \"show\": true\n", " },\n", " \"saveAsImage\": {\n", " \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\",\n", " \"show\": true\n", " },\n", " \"restore\": {\n", " \"show\": true\n", " }\n", " },\n", " \"left\": \"95%\",\n", " \"top\": \"center\",\n", " \"show\": true,\n", " \"orient\": \"vertical\"\n", " },\n", " \"title\": [\n", " {\n", " \"text\": \"\\u7bb1\\u5f62\\u56fe\",\n", " \"subtextStyle\": {\n", " \"color\": \"#aaa\",\n", " \"fontSize\": 12\n", " },\n", " \"left\": \"auto\",\n", " \"top\": \"auto\",\n", " \"textStyle\": {\n", " \"color\": \"#000\",\n", " \"fontSize\": 18\n", " },\n", " \"subtext\": \"\"\n", " }\n", " ],\n", " \"tooltip\": {\n", " \"borderWidth\": 0,\n", " \"textStyle\": {\n", " \"color\": \"#fff\",\n", " \"fontSize\": 14\n", " },\n", " \"formatter\": null,\n", " \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n", " \"borderColor\": \"#333\",\n", " \"triggerOn\": \"mousemove|click\",\n", " \"trigger\": \"item\",\n", " \"axisPointer\": {\n", " \"type\": \"line\"\n", " }\n", " }\n", "};\n", "myChart_f77d41c1899341f2891324502cb782c6.setOption(option_f77d41c1899341f2891324502cb782c6);\n", "\n", " });\n", "</script>\n" ], "text/plain": [ "<pyecharts.charts.boxplot.Boxplot at 0x1137bb198>" ] }, "execution_count": 163, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyecharts import Boxplot\n", "\n", "\n", "boxplot = Boxplot(\"箱形图\")\n", "x_axis = ['expr1', 'expr2', 'expr3', 'expr4', 'expr5']\n", "y_axis = [\n", " [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880,\n", " 1000, 980, 930, 650, 760, 810, 1000, 1000, 960, 960],\n", " [960, 940, 960, 940, 880, 800, 850, 880, 900, 840,\n", " 830, 790, 810, 880, 880, 830, 800, 790, 760, 800],\n", " [880, 880, 880, 860, 720, 720, 620, 860, 970, 950,\n", " 880, 910, 850, 870, 840, 840, 850, 840, 840, 840],\n", " [890, 810, 810, 820, 800, 770, 760, 740, 750, 760,\n", " 910, 920, 890, 860, 880, 720, 840, 850, 850, 780],\n", " [890, 840, 780, 810, 760, 810, 790, 810, 820, 850,\n", " 870, 870, 810, 740, 810, 940, 950, 800, 810, 870]\n", "]\n", "_yaxis = boxplot.prepare_data(y_axis)\n", "boxplot.add(\"boxplot\", x_axis, _yaxis)\n", "boxplot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python [conda env:anaconda]", "language": "python", "name": "conda-env-anaconda-py" }, "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.5.4" }, "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": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }