Progress with GroovyChart - the JFreeChart builder for Groovy by Dave Cherry
| Keywords: | groovy jfreechart |
| Last Change: | 16-Mar-2008 09:27 |
Its been several weeks since I last discussed wrapping JFreeChart in Groovy. Although I've been quiet - there is some good news. I have taken the java.net project groovychart and started to develop on top of it. Although this implementation is currently in Java; which means its more complex than it may have been in Groovy because of Java's strong typing, it is very comprehensive in its coverage.
Yesterday, I sent a mail to the community manager at java.net, asking for permission to work on the project. This is really needed as without this I would have to take a cut of whats there and move it to another host - I dont really want to do that.
Since I last blogged, I have got hold of the source from java.net, done some major refactoring of the way builders are stacked, then got it all working again. I also added pie chart support (my favourite chart).
import net.java.dev.groovychart.chart.ChartBuilder
import groovy.swing.SwingBuilder
import java.awt.BorderLayout as BL
import javax.swing.JFrame
import java.awt.Color
import java.awt.Dimension
import org.jfree.chart.ChartPanel
ChartBuilder cb = new ChartBuilder();
def pieChart = cb.piechart3d(title: "Simple Pie Chart") {
defaultPieDataset {
Series1(40.0f)
Series2(30.0f)
Series3(30.0f)
}
antiAlias = true
backgroundPaint(Color.WHITE)
}
def sb = new SwingBuilder()
def fr = sb.frame( title : 'Simple Pie Chart', size:[600, 400],
defaultCloseOperation: JFrame.EXIT_ON_CLOSE) {
widget(new ChartPanel(pieChart.chart), constraints: BL.CENTER)
}
fr.pack();
fr.show();

Ignore the "defaultPieDataset" in the chart, a fix for this is in progress.
Hopefully, I will get a reply from java.net soon, once I do I will commit my changes for inspection / download. However, if this does not happen within the next day or so, I will make the changes available as a zip on this website.
On 17-Mar-2008 17:24, SM wrote:
Why not put it up on code.google.com, if you are not getting replies from java.net?
Please leave a comment
(C) 1997-2009 by nutricherry Ltd,
please read our terms and conditions of use.
|
January, 2009 |
|
||||
| Su | Mo | Tu | We | Th | Fr | Sa |
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |