Any pyChart experts lend a hand?

J

john.mcginnis

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%\System32\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()
 
B

Bryan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top