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

<ul>
<li><a href="http://www.eclipse.org/articles/article.php?file=Article-BIRTChartEngine/index.html" rel="noreferrer">Eclipse BIRT Chart Engine</a> (Links to an article on how to use it)</li>
<li><a href="http://www.jfree.org/jfreechart/" rel="noreferrer">JFreeChart</a></li>
</ul>

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

[{'answer_id': 22830, 'author': 'FreeMemory', 'author_id': 2132, 'author_profile': 'https://Stackoverflow.com/users/2132', 'pm_score': 0, 'selected': False, 'text': "<p>There's also JGraph, but I'm not sure if that's only for graphs (i.e. nodes and edges), or if it does charts also.</p>\n"}, {'answer_id': 25920, 'author': 'zvikico', 'author_id': 2823, 'author_profile': 'https://Stackoverflow.com/users/2823', 'pm_score': 0, 'selected': False, 'text': "<p>Here's something different: it's very to embed web pages in SWT views. I recently tried it and it works very well. You can see where this is going: there are plenty of beautiful charting components for HTML, it could be an option. Just make sure the component is client-side only (unless you want to start a server).</p>\n\n<p>I haven't tested Flash, but I'm pretty sure you can get it to work (naturally, this means your software will require Flash plug-in installed).</p>\n"}, {'answer_id': 43112, 'author': 'Ryan P', 'author_id': 1539, 'author_profile': 'https://Stackoverflow.com/users/1539', 'pm_score': 5, 'selected': True, 'text': '<p>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 </p>\n\n<pre><code>Composite comp = new Composite(parent, SWT.NONE | SWT.EMBEDDED);\nFrame frame = SWT_AWT.new_Frame(comp);\nJFreeChart chart = createChart();\nChartPanel chartPanel = new ChartPanel(chart);\nframe.add(chartPanel);\n</code></pre>\n\n<p>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.</p>\n\n<p>@zvikico</p>\n\n<p>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.</p>\n'}, {'answer_id': 45872, 'author': 'Tibi', 'author_id': 4717, 'author_profile': 'https://Stackoverflow.com/users/4717', 'pm_score': 1, 'selected': False, 'text': '<p>There’s also <a href="http://www.ilog.com/products/jviews/charts/" rel="nofollow noreferrer">ILOG JViews Charts</a> which looks pretty feature-complete… if you can afford it.\n<a href="http://blogs.ilog.com/jviews/2008/06/17/jviews-shines-through-on-eclipse/" rel="nofollow noreferrer">Here</a> is some additional infos on using it with eclipse. </p>\n'}, {'answer_id': 48724, 'author': 'Chris Dail', 'author_id': 5077, 'author_profile': 'https://Stackoverflow.com/users/5077', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://jcharts.sourceforge.net/" rel="nofollow noreferrer">JCharts</a> is another option. It is similar to JFreeChart but the documentation is free. It does not have direct support for SWT but you can always generate an image and embed it in an SWT frame.</p>\n'}, {'answer_id': 2102436, 'author': 'Caleb Peterson', 'author_id': 225237, 'author_profile': 'https://Stackoverflow.com/users/225237', 'pm_score': 3, 'selected': False, 'text': '<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.</p>\n\n<p><a href="http://www.swtchart.org/index.html" rel="noreferrer">SWTChart</a></p>\n'}, {'answer_id': 2102528, 'author': 'Matti Lyra', 'author_id': 100190, 'author_profile': 'https://Stackoverflow.com/users/100190', 'pm_score': 2, 'selected': False, 'text': '<p>The one I\'ve used are <a href="http://jchart2d.sourceforge.net/" rel="nofollow noreferrer">JChart2D</a> 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.</p>\n\n<p>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.</p>\n\n<p>There also quite a list of charting libraries on <a href="http://www.java2s.com/Product/Java/GUI-Tools/Chart.htm" rel="nofollow noreferrer">java2s.com</a></p>\n'}, {'answer_id': 3206363, 'author': 'Martin Pernollet', 'author_id': 229513, 'author_profile': 'https://Stackoverflow.com/users/229513', 'pm_score': 1, 'selected': False, 'text': '<p>I suggest you try <a href="http://jzy3d.org/" rel="nofollow noreferrer">jzy3d</a>, a simple java library for plotting 3d data. It\'s for java, on AWT, Swing or SWT.</p>\n'}, {'answer_id': 8771380, 'author': 'Jonathan Schneider', 'author_id': 510017, 'author_profile': 'https://Stackoverflow.com/users/510017', 'pm_score': 3, 'selected': False, 'text': '<p>You might like <a href="http://code.google.com/p/swt-xy-graph/" rel="noreferrer">this</a> one too</p>\n\n<p>It has the ability to plot real time data with your own data provider.</p>\n\n<p><img src="https://i.stack.imgur.com/uYAoL.png" alt="enter image description here"></p>\n'}, {'answer_id': 9120988, 'author': 'vambo', 'author_id': 1099376, 'author_profile': 'https://Stackoverflow.com/users/1099376', 'pm_score': 2, 'selected': False, 'text': "<p>I was also looking for a charting library for an Eclipse RCP app, stumbled on Caleb's post here and can definitely recommend SWTChart now myself. It is a lot faster than JFreeChart for me, plus easily extensible. If I would really have to complain about something, I'd say the javadoc could be a bit more verbose, but this is just to say everything else is great.</p>\n"}, {'answer_id': 32049679, 'author': 'Stefan', 'author_id': 2876079, 'author_profile': 'https://Stackoverflow.com/users/2876079', 'pm_score': 1, 'selected': False, 'text': '<p>After evaluationg several options I decided to use a JavaScript library for showing plots in my Eclipse Plugin. As zvikico already suggested it is possible to show a html page in a browser. In the html page you can utilize one of the JavaScript libraries to do the actual plotting. If you use Chartist you can save the image as SVG file from the context menu. </p>\n\n<p>Some JavaScript charting libraries:</p>\n\n<ul>\n<li><p>Chartist: <a href="http://gionkunz.github.io/chartist-js" rel="nofollow noreferrer">http://gionkunz.github.io/chartist-js</a></p></li>\n<li><p>D3js: <a href="http://d3js.org" rel="nofollow noreferrer">http://d3js.org</a></p></li>\n<li><p>Flot: <a href="http://www.flotcharts.org/" rel="nofollow noreferrer">http://www.flotcharts.org/</a></p></li>\n<li><p>Further JavaScript charting frameworks: <a href="https://en.wikipedia.org/wiki/Comparison_of_JavaScript_charting_frameworks" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Comparison_of_JavaScript_charting_frameworks</a></p></li>\n</ul>\n\n<p><strong>Chartist Example image</strong>:</p>\n\n<p><a href="https://i.stack.imgur.com/oG9mD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oG9mD.png" alt="enter image description here"></a></p>\n\n<p><strong>Example java code</strong>:</p>\n\n<pre><code>package org.treez.results.chartist;\n\nimport java.net.URL;\n\nimport javafx.application.Application;\nimport javafx.concurrent.Worker;\nimport javafx.geometry.HPos;\nimport javafx.geometry.VPos;\nimport javafx.scene.Scene;\nimport javafx.scene.layout.Region;\nimport javafx.scene.paint.Color;\nimport javafx.scene.web.WebEngine;\nimport javafx.scene.web.WebView;\nimport javafx.stage.Stage;\nimport netscape.javascript.JSObject;\n\npublic class WebViewSample extends Application {\n\n    private Scene scene;\n\n    @Override\n    public void start(Stage stage) {\n        // create the scene\n        stage.setTitle("Web View");\n        Browser browser = new Browser();\n        scene = new Scene(browser, 750, 500, Color.web("#666970"));\n        stage.setScene(scene);\n        stage.show();\n    }\n\n    public static void main(String[] args) {\n        launch(args);\n    }\n}\n\nclass Browser extends Region {\n\n    final WebView browser = new WebView();\n\n    final WebEngine webEngine = browser.getEngine();\n\n    public Browser() {\n\n        //add the web view to the scene\n        getChildren().add(browser);\n\n        //add finished listener\n        webEngine.getLoadWorker().stateProperty().addListener((obs, oldState, newState) -&gt; {\n            if (newState == Worker.State.SUCCEEDED) {\n                executeJavaScript();\n            }\n        });\n\n        // load the web page\n        URL url = WebViewSample.class.getResource("chartist.html");\n        String urlPath = url.toExternalForm();\n        webEngine.load(urlPath);\n\n    }\n\n    private void executeJavaScript() {\n\n        String script = "var chartist = new Chartist.Line(" + "\'#chart\'," + " " + "{"\n                + " labels: [1, 2, 3, 4, 5, 6, 7, 8]," + "series: [" + " [5, 9, 7, 8, 5, 3, 5, 44]" + "]" + "}, " + ""\n                + "{" + "  low: 0," + "  showArea: true" + "}" + "" + ");" + " var get = function(){return chartist};";\n\n        webEngine.executeScript(script);\n\n        Object resultJs = webEngine.executeScript("get()");\n\n        //get line\n        JSObject line = (JSObject) resultJs;\n        String getKeys = "{var keys = [];for (var key in this) {keys.push(key);} keys;}";\n        JSObject linekeys = (JSObject) line.eval(getKeys);\n\n        JSObject options = (JSObject) line.eval("this.options");\n        JSObject optionkeys = (JSObject) options.eval(getKeys);\n\n        options.eval("this.showLine=false");\n\n    }\n\n    @Override\n    protected void layoutChildren() {\n        double w = getWidth();\n        double h = getHeight();\n        layoutInArea(browser, 0, 0, w, h, 0, HPos.CENTER, VPos.CENTER);\n    }\n\n    @Override\n    protected double computePrefWidth(double height) {\n        return 750;\n    }\n\n    @Override\n    protected double computePrefHeight(double width) {\n        return 500;\n    }\n}\n</code></pre>\n\n<p><strong>Example html page</strong>:</p>\n\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;link rel="stylesheet" type="text/css" href="chartist.min.css"&gt;       \n&lt;/head&gt;\n&lt;body&gt;\n    &lt;div class="ct-chart" id="chart"&gt;&lt;/div&gt;\n    &lt;script type="text/javascript" src="chartist.js"&gt;&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>In order to get this working, chartist.js and chartist.min.css need to be downloaded and put at the same location as the html file. You could also include them from the web. See here for another example:\n<a href="https://www.snip2code.com/Snippet/233633/Chartist-js-example" rel="nofollow noreferrer">https://www.snip2code.com/Snippet/233633/Chartist-js-example</a></p>\n\n<p><strong>Edit</strong></p>\n\n<p>I created a java wrapper for D3.js, see</p>\n\n<p><a href="https://github.com/stefaneidelloth/javafx-d3" rel="nofollow noreferrer">https://github.com/stefaneidelloth/javafx-d3</a></p>\n'}]
['https://Stackoverflow.com/questions/22816', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1793/']