Skip to main content

Pie chart demo

15 replies [Last post]
mortennobel
Offline
Joined: 2004-11-03
Points: 0

I have created a small Pie Chart scenegraph demo-applet.

http://www.nobel-joergensen.com/java/projects/piechart/index.jsp

Comments are welcome :-)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
surikov
Offline
Joined: 2007-05-26
Points: 0
Joshua Marinacci

Hi Surikov. This looks great. Is this done in JavaFX Script or
directly in Java with the Scenegraph library?

- Josh

On Jun 21, 2008, at 11:49 PM, scenario@javadesktop.org wrote:

> another chart demo
>
> http://molgav.nn.ru/index.php?view=article&catid=34%3Aexample&id=241%3A-...
> [Message sent by forum member 'surikov' (surikov)]
>
> http://forums.java.net/jive/thread.jspa?messageID=281831
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

surikov
Offline
Joined: 2007-05-26
Points: 0

this is JavaFX (interpreted version)

You can open JFXCharts.jar in WinZip to examine .fx files

thamizh
Offline
Joined: 2005-11-25
Points: 0

Hi surikov,

the above link is hacked. can you point me where i can get the zip file?

rajesh_shinde
Offline
Joined: 2008-06-18
Points: 0

hi morten,

I have downloaded batik-all-1.6.jar and also Scenario-0.6.jar file along with ur code of PieChart for 1.5 in my NetWeaver Developer Studio. The problem is whenever i try to run it, the pie chart doesnt get developed fully..i mean even if i give only 2 variables it doesnt cover-up all 360 degree space of pie chart. I have debugged it but am not getting it.
Can you please help me in same.

thanks in advance
regards,
rajesh shinde

mortennobel
Offline
Joined: 2004-11-03
Points: 0

The pie chart demo was made for Scenegraph 0.4.
Since then the TimingTarget interface has changed signature, so you have to change the method timingEvent(float fraction) into timingEvent(float fraction, long totalElapsed) to make it work under newer releases of Scenegraph

- Morten

rajesh_shinde
Offline
Joined: 2008-06-18
Points: 0

thanks a lot morten..its working fine now.
:)

Patrick Wright

Works great for me; Linux Gutsy with JDK 1.6 (tried the regular, and
the EA releases). Very nice work.

Patrick

Minor improvement to the applet's presentation on the page: The intro
animation is a very cool effect, maybe you could move the applet up on
the page so that it's visible when the page loads? I only noticed it
on a reload, and had to be scrolled down to the applet to see it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

Toula Michael

Very cool...but on windows only.
I couldn't load it on my Mac. I guess it is because it has been
compiled in java 1.6.
Here is the stack strace:
java.lang.UnsupportedClassVersionError: Bad version number in .class
file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:147)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:591)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:723)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1863)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:652)
at sun.applet.AppletPanel.run(AppletPanel.java:326)
at java.lang.Thread.run(Thread.java:613)

Best,
Mike

On 20 janv. 08, at 21:51, scenario@javadesktop.org wrote:

> I have created a small Pie Chart scenegraph demo-applet.
>
> http://www.nobel-joergensen.com/java/projects/piechart/index.jsp
>
> Comments are welcome :-)
> [Message sent by forum member 'mortennobel' (mortennobel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=254900
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

mortennobel
Offline
Joined: 2004-11-03
Points: 0

Hi Mike

I have created a java 1.5 friendly version of the Pie Chart demo

To make my demo run under 1.5, I have exchanged the java 1.6 class java.awt.RadialGradientPaint with org.apache.batik.ext.awt.RadialGradientPaint (from the Apache Batik framework).

Check it out on

http://www.nobel-joergensen.com/java/projects/piechart/jdk15.jsp

Kind regards,
Morten

Toula Michael

Morten,

Unfortunately it does not work on OS X.
Here is the stack trace I get:

Exception in thread "AWT-EventQueue-4" java.lang.NullPointerException
at org.apache.batik.ext.awt.RadialGradientPaintContext.
(Unknown Source)
at org.apache.batik.ext.awt.RadialGradientPaint.createContext
(Unknown Source)
at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:760)
at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:
1047)
at apple.awt.CPeerSurfaceData.setupGraphicsState
(CPeerSurfaceData.java:133)
at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:
1013)
at apple.awt.OSXSurfaceData.drawfillShape(OSXSurfaceData.java:1346)
at apple.awt.CRenderer.drawfillShape(CRenderer.java:536)
at apple.awt.CRenderer.fill(CRenderer.java:574)
at apple.awt.CRenderer.fill(CRenderer.java:561)
at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:142)
at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2574)
at com.sun.scenario.scenegraph.SGShape.paint(SGShape.java:120)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:348)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:449)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:371)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:449)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:371)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:449)
at com.sun.scenario.scenegraph.JSGPanel.render(JSGPanel.java:449)
at com.sun.scenario.scenegraph.JSGPanel.paintComponent(JSGPanel.java:
470)
at javax.swing.JComponent.paint(JComponent.java:1006)
at javax.swing.JComponent.paintChildren(JComponent.java:843)
at javax.swing.JComponent.paint(JComponent.java:1015)
at javax.swing.JComponent.paintChildren(JComponent.java:843)
at javax.swing.JComponent.paint(JComponent.java:1015)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:559)
at javax.swing.JComponent.paintChildren(JComponent.java:843)
at javax.swing.JComponent.paint(JComponent.java:1015)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:
34)
at sun.awt.SunGraphicsCallback.runOneComponent
(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents
(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1722)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
at sun.awt.RepaintArea.paint(RepaintArea.java:241)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:251)
at java.awt.Component.dispatchEventImpl(Component.java:4126)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3885)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Good real world example of the problems you get because of the lack
of Java 6 on OS X.
I wonder if you could use the RadialGradientPaint class (src/share/
classes/java/awt/RadialGradientPaint.java) form OpenJDK (http://
download.java.net/openjdk/jdk7/) as it is GPL.
You would need to add 4 class (RadialGradientPaint,
RadialGradientPaintContext, MultipleGradientPaint,
MultipleGradientPaintContext) to your jar.

Hope this helps,
Mike

On 21 janv. 08, at 08:43, scenario@javadesktop.org wrote:

> Hi Mike
>
> I have created a java 1.5 friendly version of the Pie Chart demo
>
> To make my demo run under 1.5, I have exchanged the java 1.6 class
> java.awt.RadialGradientPaint with
> org.apache.batik.ext.awt.RadialGradientPaint (from the Apache Batik
> framework).
>
> Check it out on
>
> http://www.nobel-joergensen.com/java/projects/piechart/jdk15.jsp
>
> Kind regards,
> Morten
> [Message sent by forum member 'mortennobel' (mortennobel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=254931
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

Joshua Smith

What version of Java are you running and what version of Mac OS X are you
running? Java 6 is now available as a developer preview if you're running
Leopard.

http://developer.apple.com/java/

Will it work under Java 6 on Leopard?

Josh
[att1.html]

Toula Michael

I'm still on Tiger.

Best,
Mike

On 21 janv. 08, at 16:38, Joshua Smith wrote:

> What version of Java are you running and what version of Mac OS X
> are you running? Java 6 is now available as a developer preview if
> you're running Leopard.
>
> http://developer.apple.com/java/
>
> Will it work under Java 6 on Leopard?
>
> Josh

[att1.html]

mortennobel
Offline
Joined: 2004-11-03
Points: 0

Hi Mike

Seems to be a Mac OSX specific error in the batik framework.
(See http://www.nabble.com/DO-NOT-REPLY--Bug-44194---New:----RadialGradientPa... )

I have applied a patch for the bug, so hopefully you'll finally see my Pie Chart :-)

http://www.nobel-joergensen.com/java/projects/piechart/jdk15.jsp

Kind regards,
Morten

Toula Michael

It works now :o)

On 21 janv. 08, at 21:05, scenario@javadesktop.org wrote:

> Hi Mike
>
> Seems to be a Mac OSX specific error in the batik framework.
> (See http://www.nabble.com/DO-NOT-REPLY--Bug-44194---New:----
> RadialGradientPaintContext:-hints-can-be-null-td14725784.html )
>
> I have applied a patch for the bug, so hopefully you'll finally see
> my Pie Chart :-)
>
> http://www.nobel-joergensen.com/java/projects/piechart/jdk15.jsp
>
> Kind regards,
> Morten
> [Message sent by forum member 'mortennobel' (mortennobel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=255042
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net