Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libraries for pretty charts in SWT? [closed]

I know the following libraries for drawing charts in an SWT/Eclipse RCP application:

  • Eclipse BIRT Chart Engine (Links to an article on how to use it)
  • JFreeChart

Which other libraries are there for drawing pretty charts with SWT? Or charts in Java generally? After all, you can always display an image...

like image 466
Martin Klinke Avatar asked Aug 22 '08 16:08

Martin Klinke


4 Answers

I have not used BIRT or JGraph, however I use JFreeChart in my SWT application. I have found the best way to use JFreeChart in SWT is by making a composite an AWT frame and using the AWT functionality for JFreeChart. The way to do this is by creating a composite

Composite comp = new Composite(parent, SWT.NONE | SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(comp);
JFreeChart chart = createChart();
ChartPanel chartPanel = new ChartPanel(chart);
frame.add(chartPanel);

There are several problems in regards to implementations across different platforms as well as the SWT code in it is very poor (in its defense Mr. Gilbert does not know SWT well and it is made for AWT). My two biggest problems are as AWT events bubble up through SWT there are some erroneous events fired and due to wrapping the AWT frame JFreeChart becomes substantially slower.

@zvikico

The idea of putting the chart into a web page is probably not a great way to go. There are a few problems first being how Eclipse handles integrating the web browser on different platforms is inconsistent. Also from my understanding of a few graphing packages for the web they are server side requiring that setup, also many companies including mine use proxy servers and sometimes this creates issues with the Eclipse web browsing.

like image 140
Ryan P Avatar answered Sep 21 '22 09:09

Ryan P


SWTChart gives good results for line, scatter, bar, and area charts. The API is straight forward and there are numerous examples on the website. I went from finding it on google to viewing my data in less than an hour.

SWTChart

like image 41
Caleb Peterson Avatar answered Sep 19 '22 09:09

Caleb Peterson


You might like this one too

It has the ability to plot real time data with your own data provider.

enter image description here

like image 6
Jonathan Schneider Avatar answered Sep 22 '22 09:09

Jonathan Schneider


The one I've used are JChart2D and JFreeChart. I did a live plotter application over the summer and used JFreeChart for that. The guy who had started the project had used JChart2D but I found that it doesn't have enough options for tweaking the chart look and feel.

JChart2D is supposed to be very fast so if you need to do live plotting have a look at it, although JFreeChart didn't have any problems doing a plot a few times per second.

There also quite a list of charting libraries on java2s.com

like image 2
Matti Lyra Avatar answered Sep 21 '22 09:09

Matti Lyra