Closed AlexZenghuashan closed 5 years ago
Pyecharts 多个饼图,按照http://pyecharts.org/#/zh-cn/charts_base的教学无法成功显示。 如果我define了Style 依然不能成功,请问这里的代码应如何写呢? Example: I get IOError when running my script to load files.
import pyecharts from pyecharts import Pie
pie = Pie('分类浏览中点赞超50的"受欢迎文章"所占的比例', "数据来源:人人都是产品经理", title_pos='center') Style=[] style = Style() pie_style = style.add(label_pos="center", is_label_show=True, label_text_color=None) pie.add("", ["AI人工智能", ""], [25, 75], center=[15, 30], radius=[18, 24], pie_style) pie.add("", ["blockchain", ""], [24, 76], center=[30, 30], radius=[18, 24], pie_style) pie.add("", ["业界动态", ""], [14, 86], center=[45, 30], radius=[18, 24], pie_style) pie.add("", ["交互体验", ""], [11, 89], center=[60, 30], radius=[18, 24], pie_style) pie.add("", ["产品经理", ""], [27, 73], center=[75, 30], radius=[18, 24], pie_style) pie.add("", ["产品运营", ""], [15, 85], center=[90, 30], radius=[18, 24], pie_style) pie.add("", ["分析评测", ""], [54, 46], center=[15, 75], radius=[18, 24], pie_style) pie.add("", ["创业学院", ""], [26, 74], center=[30, 75], radius=[18, 24], pie_style) pie.add("", ["职场攻略", ""], [26, 74], center=[45, 75], radius=[18, 24], pie_style) pie.add("", ["营销推广", ""], [26, 74], center=[60, 75], radius=[18, 24], pie_style) pie.add("", ["原型设计", ""], [25, 75], center=[75, 75], radius=[18, 24], pie_style) pie.add("", ["产品设计", ""], [28, 72], center=[90, 75], radius=[18, 24], legend_top="center", pie_style) pie.render() pie
open('path-to-a-file-not-exist')
@AlexZenghuashan Its the pyecharts problem. You may solve the problem by add this line at the beginning
from pyecharts import Style
Problem is solved. Thank you!
Troubleshooting
Describe your environment
Describe your question
Pyecharts 多个饼图,按照http://pyecharts.org/#/zh-cn/charts_base的教学无法成功显示。 如果我define了Style 依然不能成功,请问这里的代码应如何写呢? Example: I get IOError when running my script to load files.
The minimum code (snippet) to reproduce the issue
import pyecharts from pyecharts import Pie
pie = Pie('分类浏览中点赞超50的"受欢迎文章"所占的比例', "数据来源:人人都是产品经理", title_pos='center') Style=[] style = Style() pie_style = style.add(label_pos="center", is_label_show=True, label_text_color=None) pie.add("", ["AI人工智能", ""], [25, 75], center=[15, 30], radius=[18, 24], pie_style) pie.add("", ["blockchain", ""], [24, 76], center=[30, 30], radius=[18, 24], pie_style) pie.add("", ["业界动态", ""], [14, 86], center=[45, 30], radius=[18, 24], pie_style) pie.add("", ["交互体验", ""], [11, 89], center=[60, 30], radius=[18, 24], pie_style) pie.add("", ["产品经理", ""], [27, 73], center=[75, 30], radius=[18, 24], pie_style) pie.add("", ["产品运营", ""], [15, 85], center=[90, 30], radius=[18, 24], pie_style) pie.add("", ["分析评测", ""], [54, 46], center=[15, 75], radius=[18, 24], pie_style) pie.add("", ["创业学院", ""], [26, 74], center=[30, 75], radius=[18, 24], pie_style) pie.add("", ["职场攻略", ""], [26, 74], center=[45, 75], radius=[18, 24], pie_style) pie.add("", ["营销推广", ""], [26, 74], center=[60, 75], radius=[18, 24], pie_style) pie.add("", ["原型设计", ""], [25, 75], center=[75, 75], radius=[18, 24], pie_style) pie.add("", ["产品设计", ""], [28, 72], center=[90, 75], radius=[18, 24], legend_top="center", pie_style) pie.render() pie