unfortunatly sourceforge doesn't allow more than 5 screenshot.
if you want to see how the piechart looks like have a look at the
freecode page http://freecode.com/projects/jchartlib
and click on the screenshot there.
Here is a sample code for a piechart
/**
import com.bitagentur.data.JChartLibSerie;
import com.bitagentur.renderer.JChartLibPanel;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.Random;
import javax.swing.JFrame;
/**
A simple demonstration application showing how to create a pie chart.
*
*/
public class JChartLibApp_piechart extends JFrame implements WindowListener {
/**
Creates a new Application Frame
*/
public JChartLibApp_piechart() {
super("JChartLib Demo Appllication");
final JChartLibDataSet dataset = createDataset();
final JChartLibPiechart chart = createChart(dataset);
final JChartLibPanel chartPanel = new JChartLibPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
}
/**
@return a sample dataset.
*/
private JChartLibDataSet createDataset() {
//or by generating a Dataserie object
JChartLibSerie values1 = new JChartLibSerie("Fruits");
values1.addValue("Apple", 1);
values1.addValue("Banana", 1);
values1.addValue("Orange", 1);
values1.addValue("Tomato", 1);
final JChartLibDataSet dataset = new JChartLibDataSet();
dataset.addDataSerie(values1); //adds the Apples
return dataset;
}
/**
@return a new chart
*/
private JChartLibPiechart createChart(final JChartLibDataSet dataset) {
// create the chart with title and axis names
final JChartLibPiechart chart = new JChartLibPiechart(
"yammi fruitpie", // chart title
"", // x axis text
"", // y axis text
dataset // data
);
return chart;
}
/**
@Override
public void windowOpened(WindowEvent e) {
//Nothing to do
}
@Override
public void windowClosing(WindowEvent e) {
//Exit and goodby
if (e.getWindow() == this) {
dispose();
System.out.println("Thanks for using the JChartLibApp");
System.exit(0);
}
}
@Override
public void windowClosed(WindowEvent e) {
//Nothing to do
}
@Override
public void windowIconified(WindowEvent e) {
//Nothing to do
}
@Override
public void windowDeiconified(WindowEvent e) {
//Nothing to do
}
@Override
public void windowActivated(WindowEvent e) {
//Nothing to do
}
@Override
public void windowDeactivated(WindowEvent e) {
//Nothing to do
}
}