jupyternotebook用echarts作图并显示在当前页面

一、jupyter用echarts作图并直接显示在当前页面

版本:PyEcharts V1.0.X

#饼图
from pyecharts import options as opts
from pyecharts.charts import Pie
print(good_rate)
shangpinpingjia_name = ['好评', '中评','差评']
shangpinpingjia_count = [923, 76, 70]
pie = Pie()
pie.add("", [list(z) for z in zip(shangpinpingjia_name, shangpinpingjia_count)])
pie.set_colors(["#f33165", "Orange", "#499c9f"])
pie.render_notebook()

效果:
jupyternotebook用echarts作图并显示在当前页面_第1张图片

# 柱状图
from pyecharts import options as opts 
from pyecharts.charts import Bar
from pyecharts.charts import *
bar = Bar()
bar.set_colors(['#b7cd3d'])
bar.add_xaxis(['一月','二月','三月','四月'])                
bar.add_yaxis("title",[30,50,20,70] )
bar.render_notebook()

效果:
jupyternotebook用echarts作图并显示在当前页面_第2张图片

二、pyecharts支持的颜色

可以从下面的网页中查找
https://www.fontke.com/tool/rgb/list/2/

三、参考博客

jupyter notebook 中输出pyecharts图
Pyecharts上的颜色设置

你可能感兴趣的:(python,Jupyter,Notebook)