参考例子:http://blog.csdn.net/carolzhang8406/article/details/6900504
from pychart import *
import sys
theme.get_options()
theme.use_color = True
can = canvas.init('pic1.png')
data = [("foo", 10),("bar", 20), ("baz", 30), ("ao", 40)]
ar = area.T(size=(300,300), legend=legend.T(),
x_grid_style = None, y_grid_style = None)
plot = pie_plot.T(data=data, arc_offsets=[0,10,0,10],
shadow = (2, -2, fill_style.gray50),
label_offset = 25,
arrow_style = arrow.a3)
ar.add_plot(plot)
ar.draw()
运行例子中的程序,总是提示:
Traceback (most recent call last):
File "E:/AndroidTest/pychart.py", line 1, in
from pychart import *
File "E:\AndroidTest\pychart.py", line 3, in
theme.get_options()
NameError: name 'theme' is not defined
在我的 Python 目录下明明有这个 theme!!
目录路径:D:\Python\Lib\site-packages\pychart