jpype with JFreeChart, anyone interested to help?


O

oyster

As you may know, there is no beautiful and free chart(not plot, you
can find the examples at http://www.jfree.org/jfreechart,
http://www.rmchart.com) module for python than runs on
windows/linux/mac osx.

On the other hand, there is a living
package(http://www.jfree.org/jfreechart) for java, and it is nice. So
what about make the interface to JFreeChart via
jpype(http://jpype.sourceforge.net), or rewrite JFreeChart in and for
Python to kick off JVM?

I have tried this, but since I don't know Java, I did not go further.
If anyone can help me with the following code, or organzie a
py_jfreechart team, or put up a pyFreeChart team, that would be great.

Thanks

Code:
import jpype

p=r'e:\Java\j2re1.4.0\bin\client\jvm.dll'
jpype.startJVM(p,
r'-Djava.class.path=h:\jfreechart-1.0.9\lib\jfreechart-1.0.9.jar' )

pkg=jpype.JPackage("org.jfree.data")
print pkg.DefaultKeyedValues
print pkg.DefaultKeyedValues.DefaultKeyedValues
print pkg.DefaultKeyedValues.DefaultKeyedValues.DefaultKeyedValues

jc=jpype.JClass("org.jfree.data.DefaultKeyedValues")

[msg]
<Java package org.jfree.data.DefaultKeyedValues>
<Java package org.jfree.data.DefaultKeyedValues.DefaultKeyedValues>
<Java package org.jfree.data.DefaultKeyedValues.DefaultKeyedValues.DefaultKeyedV
alues>
Traceback (most recent call last):
File "H:\jfreechart-1.0.9\lib\b.py", line 11, in <module>
jc=jpype.JClass("org.jfree.data.DefaultKeyedValues")
File "H:\jfreechart-1.0.9\lib\jpype\_jclass.py", line 54, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.ExceptionPyRaisable: java.lang.Exception: Class
org.jfree.data.DefaultKeyedValues not found
[/msg]
 
Ad

Advertisements


Top