散點圖
基本案例
from example.commons import Faker from pyecharts import options as opts from pyecharts.charts import EffectScatter from pyecharts.globals import SymbolType c = ( EffectScatter() .add_xaxis(["襯衫", "毛衣", "領帶", "褲子", "風衣", "高跟鞋", "襪子"]) .add_yaxis('商家A', [114, 55, 27, 101, 125, 27, 105]) .add_yaxis('商家B',[57, 134, 137, 129, 145, 60, 49]) .set_global_opts(title_opts=opts.TitleOpts(title="EffectScatter-基本示例")) ) c.render_notebook()
散點圖顯示分割線
from example.commons import Faker from pyecharts import options as opts from pyecharts.charts import EffectScatter from pyecharts.globals import SymbolType c = ( EffectScatter() .add_xaxis(["襯衫", "毛衣", "領帶", "褲子", "風衣", "高跟鞋", "襪子"]) .add_yaxis('商家A', [114, 55, 27, 101, 125, 27, 105]) .add_yaxis('商家B',[57, 134, 137, 129, 145, 60, 49]) # .set_global_opts(title_opts=opts.TitleOpts(title="EffectScatter-基本示例")) .set_global_opts( title_opts=opts.TitleOpts(title="EffectScatter-顯示分割線"), xaxis_opts=opts.AxisOpts(splitline_opts=opts.SplitLineOpts(is_show=True)), yaxis_opts=opts.AxisOpts(splitline_opts=opts.SplitLineOpts(is_show=True)), ) ) c.render_notebook()