By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

Any pyChart experts lend a hand?

P: n/a
I am attempting to generate some graphics prior to display on a
webpage. I have GhostScript 8.x loaded. And I can from the code below
generate the desired graphic. (it's right out of the /demos, pietest.py
with some mods) Works great. However were I to paste this into the main
flow of my program it fails to gen the graph. Simply no output. I do
not produce any errors at run time. I am assuming that I have some
pathing wrong.

Running on a WinXP box:

Main program is at : c:\Comp\
Spot for graphic land is at : c:\Comp\graphic\
pyChart is located at : C:\Python24\pyChart\
pyChart libraries located at : C:\Python24\Lib\site-packages\pychart
GhostScript located at : C:\gs\gs8.14\bin

PYTHONPATH :
c:\Python24;c:\Python24\Kari;c:\Python24\pyChart;C :\Python24\Lib\site-packages\pychart;c:\Comp

PATH :
c:\WINDOWS\system32;c:\WINDOWS\;%SystemRoot%\Syste m32\Wbem;C:\Program
Files\OpenSSH\bin;c:\PHP;C:\Program Files\ATI Technologies\ATI Control
Panel;c:\python24;C:\Python24\pyChart;C:\Python24\ Lib\site-packages\pychart;C:\OpenSSH\bin;C:\Comp;C:\gs\gs8. 14\bin

Anyone see anything that I missed?
Code
----------------------------------------------------
from pychart import *
import sys
theme.get_options()

theme.use_color = True
theme.output_format="png"
theme.output_file="C:\Comp\graphic\pic1.png"
theme.reinitialize()

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()

Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
jo***********@comcast.net wrote:
Code
----------------------------------------------------
from pychart import *
import sys
theme.get_options()

theme.use_color = True
theme.output_format="png"
theme.output_file="C:\Comp\graphic\pic1.png"
theme.reinitialize()

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()
i've been playing with pychart for exactly 5 minutes just before i read your
post, so i doubt that makes me an expert, but i did your code to work by
changing your code to this:
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()

bryan

Jul 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.