{"id":999552,"date":"2024-12-27T09:42:32","date_gmt":"2024-12-27T01:42:32","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/999552.html"},"modified":"2024-12-27T09:42:34","modified_gmt":"2024-12-27T01:42:34","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8echarts","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/999552.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u4f7f\u7528echarts"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074513\/0048d25c-6595-4802-a753-b4345697316e.webp\" alt=\"python\u4e2d\u5982\u4f55\u4f7f\u7528echarts\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u4f7f\u7528ECharts\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u4e3b\u8981\u5305\u62ec\uff1apyecharts\u5e93\u3001Jupyter Notebook\u96c6\u6210\u3001\u4f7f\u7528Flask\/Django\u7b49Web\u6846\u67b6<\/strong>\u3002\u5176\u4e2d\uff0cpyecharts\u662f\u6700\u5e38\u7528\u7684\u65b9\u5f0f\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2aPython\u63a5\u53e3\u6765\u751f\u6210ECharts\u56fe\u8868\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528pyecharts\u6765\u521b\u5efa\u53ef\u89c6\u5316\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528PYECHARTS\u5e93<\/p>\n<\/p>\n<p><p>pyecharts\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u5e93\uff0c\u80fd\u591f\u751f\u6210\u590d\u6742\u7684ECharts\u56fe\u8868\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\u901a\u8fc7Python\u4ee3\u7801\u751f\u6210HTML\/JavaScript\u4ee3\u7801\uff0c\u8fd9\u6837\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5728Web\u9875\u9762\u4e2d\u5c55\u793a\u56fe\u8868\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5pyecharts<\/li>\n<\/ol>\n<p><p>\u8981\u4f7f\u7528pyecharts\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u8fd9\u4e2a\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7pip\u6765\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyecharts<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728Python\u4e2d\u4f7f\u7528\u5b83\u6765\u521b\u5efa\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u8868\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u521b\u5efa\u7b80\u5355\u7684\u6298\u7ebf\u56fe<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528pyecharts\u521b\u5efa\u7b80\u5355\u6298\u7ebf\u56fe\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Line<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6298\u7ebf\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>line = Line()<\/p>\n<h2><strong>\u6dfb\u52a0\u6570\u636e<\/strong><\/h2>\n<p>line.add_xaxis([&quot;\u5468\u4e00&quot;, &quot;\u5468\u4e8c&quot;, &quot;\u5468\u4e09&quot;, &quot;\u5468\u56db&quot;, &quot;\u5468\u4e94&quot;, &quot;\u5468\u516d&quot;, &quot;\u5468\u65e5&quot;])<\/p>\n<p>line.add_yaxis(&quot;\u9500\u91cf&quot;, [820, 932, 901, 934, 1290, 1330, 1320])<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u8868\u7684\u6807\u9898<\/strong><\/h2>\n<p>line.set_global_opts(title_opts=opts.TitleOpts(title=&quot;\u67d0\u5546\u5e97\u4e00\u5468\u9500\u91cf&quot;))<\/p>\n<h2><strong>\u6e32\u67d3\u4e3aHTML\u6587\u4ef6<\/strong><\/h2>\n<p>line.render(&quot;line_chart.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u4ee3\u7801\u6bb5\u5c55\u793a\u4e86\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u6298\u7ebf\u56fe\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3aHTML\u6587\u4ef6\u3002\u4f60\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u6765\u67e5\u770b\u56fe\u8868\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u81ea\u5b9a\u4e49\u56fe\u8868\u6837\u5f0f<\/li>\n<\/ol>\n<p><p>pyecharts\u63d0\u4f9b\u4e86\u8bb8\u591a\u9009\u9879\u6765\u81ea\u5b9a\u4e49\u56fe\u8868\u7684\u6837\u5f0f\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u66f4\u6539\u989c\u8272\u3001\u6dfb\u52a0\u56fe\u4f8b\u3001\u8bbe\u7f6e\u8f74\u6807\u7b7e\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u56fe\u8868\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">line.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u81ea\u5b9a\u4e49\u6298\u7ebf\u56fe&quot;),<\/p>\n<p>    xaxis_opts=opts.AxisOpts(name=&quot;\u65e5\u671f&quot;),<\/p>\n<p>    yaxis_opts=opts.AxisOpts(name=&quot;\u9500\u91cf&quot;),<\/p>\n<p>    legend_opts=opts.LegendOpts(is_show=True),<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u9009\u9879\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8c03\u6574\u56fe\u8868\u7684\u5916\u89c2\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5728Jupyter Notebook\u4e2d\u4f7f\u7528ECharts<\/p>\n<\/p>\n<p><p>pyecharts\u4e0eJupyter Notebook\u6709\u5f88\u597d\u7684\u96c6\u6210\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728Notebook\u4e2d\u663e\u793a\u56fe\u8868\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Jupyter Notebook\u652f\u6301<\/li>\n<\/ol>\n<p><p>\u5728\u4f7f\u7528pyecharts\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u4e86Jupyter Notebook\u3002\u5982\u679c\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u5728Notebook\u4e2d\u663e\u793a\u56fe\u8868<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528pyecharts\u521b\u5efa\u56fe\u8868\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5728Jupyter Notebook\u4e2d\u663e\u793a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Bar<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>bar = Bar()<\/p>\n<p>bar.add_xaxis([&quot;\u82f9\u679c&quot;, &quot;\u9999\u8549&quot;, &quot;\u6a59\u5b50&quot;])<\/p>\n<p>bar.add_yaxis(&quot;\u6570\u91cf&quot;, [5, 20, 36])<\/p>\n<h2><strong>\u8bbe\u7f6e\u663e\u793a\u9009\u9879<\/strong><\/h2>\n<p>bar.set_global_opts(title_opts=opts.TitleOpts(title=&quot;\u6c34\u679c\u6570\u91cf\u67f1\u72b6\u56fe&quot;))<\/p>\n<h2><strong>\u5728Notebook\u4e2d\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>from pyecharts.globals import CurrentConfig, NotebookType<\/p>\n<p>CurrentConfig.NOTEBOOK_TYPE = NotebookType.JUPYTER_LAB<\/p>\n<p>bar.render_notebook()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8c03\u7528<code>render_notebook()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728Notebook\u4e2d\u5d4c\u5165\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4e0eWeb\u6846\u67b6\u96c6\u6210<\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5728Web\u5e94\u7528\u4e2d\u4f7f\u7528ECharts\uff0cpyecharts\u4e5f\u63d0\u4f9b\u4e86\u4e0eFlask\u3001Django\u7b49Web\u6846\u67b6\u7684\u96c6\u6210\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528Flask\u96c6\u6210<\/li>\n<\/ol>\n<p><p>Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u6846\u67b6\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u4e0epyecharts\u96c6\u6210\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, render_template<\/p>\n<p>from pyecharts.charts import Pie<\/p>\n<p>from pyecharts import options as opts<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&quot;\/&quot;)<\/p>\n<p>def index():<\/p>\n<p>    # \u521b\u5efa\u4e00\u4e2a\u997c\u56fe<\/p>\n<p>    pie = Pie()<\/p>\n<p>    pie.add(&quot;&quot;, [(&quot;\u82f9\u679c&quot;, 30), (&quot;\u9999\u8549&quot;, 20), (&quot;\u6a59\u5b50&quot;, 50)])<\/p>\n<p>    pie.set_global_opts(title_opts=opts.TitleOpts(title=&quot;\u6c34\u679c\u6bd4\u4f8b\u997c\u56fe&quot;))<\/p>\n<p>    # \u6e32\u67d3\u4e3aHTML\u7247\u6bb5<\/p>\n<p>    pie_html = pie.render_embed()<\/p>\n<p>    return render_template(&quot;index.html&quot;, pie_chart=pie_html)<\/p>\n<p>if __name__ == &quot;__m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n__&quot;:<\/p>\n<p>    app.run(debug=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2aFlask\u5e94\u7528\uff0c\u5e76\u5728<code>index<\/code>\u8def\u7531\u4e2d\u751f\u6210\u4e00\u4e2a\u997c\u56fe\uff0c\u7136\u540e\u5c06\u5176\u5d4c\u5165\u5230HTML\u6a21\u677f\u4e2d\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Django\u96c6\u6210<\/li>\n<\/ol>\n<p><p>Django\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Web\u6846\u67b6\uff0c\u540c\u6837\u53ef\u4ee5\u4e0epyecharts\u7ed3\u5408\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u57fa\u672c\u7684\u96c6\u6210\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fddDjango\u9879\u76ee\u5df2\u7ecf\u521b\u5efa\uff0c\u7136\u540e\u5728\u89c6\u56fe\u51fd\u6570\u4e2d\u751f\u6210ECharts\u56fe\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from django.shortcuts import render<\/p>\n<p>from pyecharts.charts import Scatter<\/p>\n<p>from pyecharts import options as opts<\/p>\n<p>def chart_view(request):<\/p>\n<p>    # \u521b\u5efa\u4e00\u4e2a\u6563\u70b9\u56fe<\/p>\n<p>    scatter = Scatter()<\/p>\n<p>    scatter.add_xaxis([10, 20, 30, 40, 50])<\/p>\n<p>    scatter.add_yaxis(&quot;A&quot;, [10, 20, 30, 40, 50])<\/p>\n<p>    scatter.set_global_opts(title_opts=opts.TitleOpts(title=&quot;\u7b80\u5355\u6563\u70b9\u56fe&quot;))<\/p>\n<p>    # \u6e32\u67d3\u4e3aHTML\u7247\u6bb5<\/p>\n<p>    scatter_html = scatter.render_embed()<\/p>\n<p>    return render(request, &#39;chart.html&#39;, {&#39;scatter_chart&#39;: scatter_html})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u63a5\u7740\uff0c\u5728\u6a21\u677f\u6587\u4ef6\u4e2d\u5d4c\u5165\u56fe\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;title&gt;Chart&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;\u6563\u70b9\u56fe\u793a\u4f8b&lt;\/h1&gt;<\/p>\n<p>    &lt;div id=&quot;scatter_chart&quot;&gt;{{ scatter_chart|<a href=\"https:\/\/docs.pingcode.com\/agile\/agile-at-scale\/what-is-safe\" target=\"_blank\">SAFe<\/a> }}&lt;\/div&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728Django\u5e94\u7528\u4e2d\u5d4c\u5165ECharts\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528ECharts\u7684\u9ad8\u7ea7\u7279\u6027<\/p>\n<\/p>\n<p><p>ECharts\u63d0\u4f9b\u4e86\u8bb8\u591a\u9ad8\u7ea7\u7279\u6027\uff0cpyecharts\u540c\u6837\u652f\u6301\u8fd9\u4e9b\u7279\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4ea4\u4e92\u548c\u52a8\u753b\u6548\u679c<\/li>\n<\/ol>\n<p><p>ECharts\u652f\u6301\u4e30\u5bcc\u7684\u4ea4\u4e92\u548c\u52a8\u753b\u6548\u679c\uff0c\u6bd4\u5982\u6570\u636e\u7f29\u653e\u3001\u62d6\u62fd\u3001\u52a8\u6001\u66f4\u65b0\u6570\u636e\u7b49\u3002\u5728pyecharts\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u76f8\u5e94\u7684\u9009\u9879\u6765\u542f\u7528\u8fd9\u4e9b\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">line.set_series_opts(<\/p>\n<p>    label_opts=opts.LabelOpts(is_show=False),<\/p>\n<p>    markpoint_opts=opts.MarkPointOpts(data=[opts.MarkPointItem(type_=&quot;max&quot;, name=&quot;\u6700\u5927\u503c&quot;)]),<\/p>\n<p>    markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_=&quot;average&quot;, name=&quot;\u5e73\u5747\u503c&quot;)])<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u591a\u56fe\u8868\u7ec4\u5408<\/li>\n<\/ol>\n<p><p>pyecharts\u652f\u6301\u5c06\u591a\u4e2a\u56fe\u8868\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u5f62\u6210\u4e00\u4e2a\u590d\u5408\u56fe\u8868\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u67f1\u72b6\u56fe\u548c\u6298\u7ebf\u56fe\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u5c55\u793a\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Grid<\/p>\n<p>bar = Bar()<\/p>\n<p>bar.add_xaxis([&quot;\u5468\u4e00&quot;, &quot;\u5468\u4e8c&quot;, &quot;\u5468\u4e09&quot;, &quot;\u5468\u56db&quot;, &quot;\u5468\u4e94&quot;, &quot;\u5468\u516d&quot;, &quot;\u5468\u65e5&quot;])<\/p>\n<p>bar.add_yaxis(&quot;\u67f1\u72b6\u56fe&quot;, [820, 932, 901, 934, 1290, 1330, 1320])<\/p>\n<p>line = Line()<\/p>\n<p>line.add_xaxis([&quot;\u5468\u4e00&quot;, &quot;\u5468\u4e8c&quot;, &quot;\u5468\u4e09&quot;, &quot;\u5468\u56db&quot;, &quot;\u5468\u4e94&quot;, &quot;\u5468\u516d&quot;, &quot;\u5468\u65e5&quot;])<\/p>\n<p>line.add_yaxis(&quot;\u6298\u7ebf\u56fe&quot;, [620, 732, 701, 734, 1090, 1130, 1120])<\/p>\n<p>grid = Grid()<\/p>\n<p>grid.add(bar, grid_opts=opts.GridOpts(pos_left=&quot;55%&quot;))<\/p>\n<p>grid.add(line, grid_opts=opts.GridOpts(pos_right=&quot;55%&quot;))<\/p>\n<p>grid.render(&quot;combined_chart.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u6570\u636e\u8054\u52a8<\/li>\n<\/ol>\n<p><p>ECharts\u652f\u6301\u6570\u636e\u8054\u52a8\u529f\u80fd\uff0c\u53ef\u4ee5\u5b9e\u73b0\u591a\u4e2a\u56fe\u8868\u4e4b\u95f4\u7684\u6570\u636e\u8054\u52a8\u3002\u4f8b\u5982\uff0c\u5f53\u5728\u4e00\u4e2a\u56fe\u8868\u4e0a\u9009\u62e9\u67d0\u4e2a\u6570\u636e\u70b9\u65f6\uff0c\u5176\u4ed6\u56fe\u8868\u4f1a\u81ea\u52a8\u66f4\u65b0\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5185\u5bb9\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528ECharts\uff0c\u5305\u62ec\u4f7f\u7528pyecharts\u5e93\u3001\u5728Jupyter Notebook\u4e2d\u96c6\u6210\u3001\u4e0eWeb\u6846\u67b6\u7ed3\u5408\u4ee5\u53ca\u5229\u7528ECharts\u7684\u9ad8\u7ea7\u7279\u6027\u3002ECharts\u4f5c\u4e3a\u4e00\u4e2a\u5f3a\u5927\u7684\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u7ed3\u5408Python\u7684\u7075\u6d3b\u6027\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u6784\u5efa\u51fa\u8272\u7684\u6570\u636e\u53ef\u89c6\u5316\u5e94\u7528\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528ECharts\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5\u548c\u914d\u7f6eEcharts\u5e93\uff1f<\/strong><br \/>\u5728Python\u4e2d\u4f7f\u7528Echarts\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u5e93\u3002\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u6765\u5b89\u88c5<code>pyecharts<\/code>\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5c06Echarts\u96c6\u6210\u5230Python\u9879\u76ee\u4e2d\u7684\u5e93\u3002\u4f7f\u7528\u547d\u4ee4<code>pip install pyecharts<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u5728\u4ee3\u7801\u4e2d\u5bfc\u5165pyecharts\u5e93\uff0c\u4ee5\u4fbf\u80fd\u591f\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u529f\u80fd\u3002<\/p>\n<p><strong>Echarts\u5728Python\u4e2d\u53ef\u4ee5\u5b9e\u73b0\u54ea\u4e9b\u53ef\u89c6\u5316\u6548\u679c\uff1f<\/strong><br \/>Echarts\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u4f7f\u7528pyecharts\u53ef\u4ee5\u521b\u5efa\u591a\u79cd\u7c7b\u578b\u7684\u56fe\u8868\uff0c\u4f8b\u5982\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u3001\u997c\u56fe\u3001\u6563\u70b9\u56fe\u7b49\u3002\u901a\u8fc7\u8c03\u6574\u56fe\u8868\u7684\u5c5e\u6027\u548c\u6837\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u5b9e\u73b0\u4e30\u5bcc\u7684\u53ef\u89c6\u5316\u6548\u679c\uff0c\u751a\u81f3\u53ef\u4ee5\u6dfb\u52a0\u4ea4\u4e92\u529f\u80fd\uff0c\u589e\u5f3a\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Jupyter Notebook\u4e2d\u5c55\u793aEcharts\u56fe\u8868\uff1f<\/strong><br \/>\u5728Jupyter Notebook\u4e2d\u4f7f\u7528Echarts\u975e\u5e38\u65b9\u4fbf\u3002\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528pyecharts\u63d0\u4f9b\u7684<code>render_notebook()<\/code>\u65b9\u6cd5\u3002\u53ea\u9700\u5728\u521b\u5efa\u5b8c\u56fe\u8868\u5bf9\u8c61\u540e\u8c03\u7528\u6b64\u65b9\u6cd5\uff0c\u56fe\u8868\u5c31\u4f1a\u5728Notebook\u4e2d\u76f4\u63a5\u6e32\u67d3\uff0c\u65b9\u4fbf\u968f\u65f6\u67e5\u770b\u548c\u8c03\u6574\u3002\u786e\u4fdd\u5b89\u88c5\u4e86<code>pyecharts<\/code>\u7684Jupyter\u652f\u6301\u5305\uff0c\u4ee5\u786e\u4fdd\u56fe\u8868\u80fd\u591f\u6b63\u5e38\u663e\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u4f7f\u7528ECharts\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u4e3b\u8981\u5305\u62ec\uff1apyecharts\u5e93\u3001Jupyter Not [&hellip;]","protected":false},"author":3,"featured_media":999561,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/999552"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=999552"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/999552\/revisions"}],"predecessor-version":[{"id":999563,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/999552\/revisions\/999563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/999561"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=999552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=999552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=999552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}