We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › JFreeChart on PApplet
Page Index Toggle Pages: 1
JFreeChart on PApplet (Read 1152 times)
JFreeChart on PApplet
Jan 10th, 2006, 7:16am
 
Hello,
I am in the process of creating supercontig/contig wide charts to represent quality scores at any given position.
The chart would be a 1- dimensional chart running across th length of the Supercontig/Contig with varying color gradient reflecting values.
This chart needs to be drawn on th same PApplet as the Supercontig/contig
Considering 2 options:
1. Use processing api to create the chart
2. Use a third party charting tool like JFreeChart.

Not sure if i can draw JFreechart type charts on PApplet
Potential complications:
1. Drawing on heavy weight PApplet
2. Integration with the cyclic draw() call driven by framerate

Any comments are welcome
regards
Sameer
 
Re: JFreeChart on PApplet
Reply #1 - Jan 10th, 2006, 3:39pm
 
you can easily use JFreeChart for making very nice
and complex charts with processing like this:

Code:

PImage chartImage;

void setup(){
size(500, 300);

// create a dataset the chart is generated from
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Processing", new Integer(75));
dataset.setValue("Other", new Integer(25));

// create the chart from dataset
JFreeChart chart = ChartFactory.createPieChart("A Pie Chart", dataset, true, false, false);

// create image from chart
chartImage = new PImage(chart.createBufferedImage(500,300));
}

void draw(){
// display chart image on screen
image(chartImage, 0, 0);
}

note: import jfreechart-1.0.0.jar & jcommon-1.0.0.jar
to your sketch.

but if you're going to use this in applets, you should
take into account the size of the jFreeChart library.
Page Index Toggle Pages: 1