Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Chart on RCP application
Chart on RCP application [message #452809] Sun, 16 July 2006 21:47 Go to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hello
I have to make a chart on the RCP application. And I am looking for chart
library for RCP.
what is your advise for chart library.Can I use birt chart library . I used
jfreechart with Swing. ok I can use jfreechart with swt, too. But I am
looking for chart library for SWT.

Thank you for your advise
Re: Chart on RCP application [message #452823 is a reply to message #452809] Mon, 17 July 2006 13:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Take a look at the birt project, it owns a charting lib.

Tom

Cenk Dundar wrote:
> Hello
> I have to make a chart on the RCP application. And I am looking for chart
> library for RCP.
> what is your advise for chart library.Can I use birt chart library . I used
> jfreechart with Swing. ok I can use jfreechart with swt, too. But I am
> looking for chart library for SWT.
>
> Thank you for your advise
>
>
Re: Chart on RCP application [message #452837 is a reply to message #452809] Mon, 17 July 2006 18:32 Go to previous messageGo to next message
Andy Czerwonka is currently offline Andy CzerwonkaFriend
Messages: 42
Registered: July 2009
Member
JFreeCharts via the SWT_AWT bridge.

"Cenk Dundar" <cenkdundar@yahoo.com> wrote in message
news:e9ec5i$2fk$1@utils.eclipse.org...
> Hello
> I have to make a chart on the RCP application. And I am looking for chart
> library for RCP.
> what is your advise for chart library.Can I use birt chart library . I
> used jfreechart with Swing. ok I can use jfreechart with swt, too. But I
> am looking for chart library for SWT.
>
> Thank you for your advise
>
Re: Chart on RCP application [message #685267 is a reply to message #452837] Fri, 17 June 2011 06:56 Go to previous messageGo to next message
chinnii  is currently offline chinnii Friend
Messages: 6
Registered: June 2011
Junior Member
hi Mr.Dundar,
I have to work with Pie Chrts using JfreeCharts(for SWT).
But in the RCP Application the Eclipse is not able to create the view.
i have the following jars :
1. jcommon-1.0.16.jar
2. jfreechart-1.0.13-experimental.jar
3. jfreechart-1.0.13-swt.jar
4. jfreechart-1.0.13.jar
5. jfreechart-1.0.4-demo.jar
6. org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar
7. swtgraphics2d.jar


it is giving error like could not instantiate view in the view.
and giving error in console like
"java.lang.NoClassDefFoundError: org/jfree/data/general/PieDataset"

i Think you only can help because you had experience with same requirement.

Thanks in advance Mr.Dundar.


The following is my view in RCP Project


package rcpchart;

import java.awt.Font;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.jfree.experimental.chart.swt.ChartComposite;



import java.awt.Font;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.jfree.experimental.chart.swt.ChartComposite;

public class View extends ViewPart {

public void createPartControl(Composite parent) {


JFreeChart chart = createChart(createDataset());
new ChartComposite(parent, SWT.NONE,
chart, true);
}

public void setFocus() {
}

/**
* Creates the Dataset for the Pie chart
*/
private PieDataset createDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("One", new Double(43.2));
dataset.setValue("Two", new Double(10.0));
dataset.setValue("Three", new Double(27.5));
dataset.setValue("Four", new Double(17.5));
dataset.setValue("Five", new Double(11.0));
dataset.setValue("Six", new Double(19.4));
return dataset;
}

/**
* Creates the Chart based on a dataset
*/
private JFreeChart createChart(PieDataset dataset) {

JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo 1", // chart
// title
dataset, // data
true, // include legend
true, false);

PiePlot plot = (PiePlot) chart.getPlot();
plot.setSectionOutlinesVisible(false);
plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
plot.setNoDataMessage("No data available");
plot.setCircular(false);
plot.setLabelGap(0.02);
return chart;

}
}
Re: Chart on RCP application [message #685304 is a reply to message #685267] Fri, 17 June 2011 08:33 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Most likely you modified the JavaBuild-Path in your Project-Settings
instead of doing it with the MANIFEST.MF.

Tom

Am 17.06.11 08:56, schrieb chinnii:
> hi Mr.Dundar,
> I have to work with Pie Chrts using JfreeCharts(for SWT).
> But in the RCP Application the Eclipse is not able to create the view.
> i have the following jars :
> 1. jcommon-1.0.16.jar
> 2. jfreechart-1.0.13-experimental.jar
> 3. jfreechart-1.0.13-swt.jar
> 4. jfreechart-1.0.13.jar
> 5. jfreechart-1.0.4-demo.jar
> 6. org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar
> 7. swtgraphics2d.jar
>
>
> it is giving error like could not instantiate view in the view.
> and giving error in console like "java.lang.NoClassDefFoundError:
> org/jfree/data/general/PieDataset"
>
> i Think you only can help because you had experience with same requirement.
>
> Thanks in advance Mr.Dundar.
>
>
> The following is my view in RCP Project
>
>
> package rcpchart;
>
> import java.awt.Font;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.ui.part.ViewPart;
> import org.jfree.chart.ChartFactory;
> import org.jfree.chart.JFreeChart;
> import org.jfree.chart.plot.PiePlot;
> import org.jfree.data.general.DefaultPieDataset;
> import org.jfree.data.general.PieDataset;
> import org.jfree.experimental.chart.swt.ChartComposite;
>
>
>
> import java.awt.Font;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.ui.part.ViewPart;
> import org.jfree.chart.ChartFactory;
> import org.jfree.chart.JFreeChart;
> import org.jfree.chart.plot.PiePlot;
> import org.jfree.data.general.DefaultPieDataset;
> import org.jfree.data.general.PieDataset;
> import org.jfree.experimental.chart.swt.ChartComposite;
>
> public class View extends ViewPart {
>
> public void createPartControl(Composite parent) {
>
>
> JFreeChart chart = createChart(createDataset());
> new ChartComposite(parent, SWT.NONE,
> chart, true);
> }
>
> public void setFocus() {
> }
>
> /**
> * Creates the Dataset for the Pie chart
> */
> private PieDataset createDataset() {
> DefaultPieDataset dataset = new DefaultPieDataset();
> dataset.setValue("One", new Double(43.2));
> dataset.setValue("Two", new Double(10.0));
> dataset.setValue("Three", new Double(27.5));
> dataset.setValue("Four", new Double(17.5));
> dataset.setValue("Five", new Double(11.0));
> dataset.setValue("Six", new Double(19.4));
> return dataset;
> }
>
> /**
> * Creates the Chart based on a dataset
> */
> private JFreeChart createChart(PieDataset dataset) {
>
> JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo
> 1", // chart
> // title
> dataset, // data
> true, // include legend
> true, false);
>
> PiePlot plot = (PiePlot) chart.getPlot();
> plot.setSectionOutlinesVisible(false);
> plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
> plot.setNoDataMessage("No data available");
> plot.setCircular(false);
> plot.setLabelGap(0.02);
> return chart;
>
> }
> }
>
Re: Chart on RCP application [message #685787 is a reply to message #685304] Mon, 20 June 2011 05:06 Go to previous message
chinnii  is currently offline chinnii Friend
Messages: 6
Registered: June 2011
Junior Member
I did not modify anything. I Just created a RCP Project through eclipse and add my changes to view after importing required jar files.
Previous Topic:Show MultiStatus collapsed by default
Next Topic:How do I add a control to the beginning of the status line?
Goto Forum:
  


Current Time: Wed Apr 24 16:52:52 GMT 2024

Powered by FUDForum. Page generated in 0.02881 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top