有没有像样的免费 Java 数据绘图库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Are there any decent free Java data plotting libraries out there?
提问by Kurt W. Leucht
On a recent Java project, we needed a free Java based real-time data plotting utility. After much searching, we found this tool called the Scientific Graphics Toolkit or SGTfrom NOAA. It seemed pretty robust, but we found out that it wasn't terribly configurable. Or at least not configurable enough to meet our needs. We ended up digging very deeply into the Java code and reverse engineering the code and changing it all around to make the plot tool look and act the way we wanted it to look and act. Of course, this killed any chance for future upgrades from NOAA.
在最近的一个 Java 项目中,我们需要一个免费的基于 Java 的实时数据绘图实用程序。经过多次搜索,我们找到了来自 NOAA 的名为Scientific Graphics Toolkit 或 SGT 的工具。它看起来很健壮,但我们发现它的可配置性并不好。或者至少没有足够的可配置性来满足我们的需求。我们最终深入挖掘了 Java 代码并对代码进行了逆向工程并对其进行了全面更改,以使绘图工具的外观和行为符合我们希望它的外观和行为方式。当然,这扼杀了 NOAA 未来升级的任何机会。
So what free or cheap Java based data plotting tools or libraries do you use?
那么您使用哪些免费或廉价的基于 Java 的数据绘图工具或库?
Followup: Thanks for the JFreeChartsuggestions. I checked out their website and it looks like a very nice data charting and plotting utility. I should have made it clear in my original question that I was looking specifically to plot real-time data. I corrected my question above to make that point clear. It appears that JFreeChart support for live data is marginal at best, though. Any other suggestions out there?
跟进:感谢JFreeChart 的建议。我查看了他们的网站,它看起来是一个非常好的数据图表和绘图实用程序。我应该在我最初的问题中明确表示我正在专门寻找绘制实时数据。我更正了我上面的问题以明确这一点。看起来JFreeChart 对实时数据的支持充其量只是微不足道的,尽管. 还有其他建议吗?
采纳答案by Will
I've had success using JFreeCharton multiple projects. It is veryconfigurable. JFreeChart is open source, but they charge for the developer guide. If you're doing something simple, the sample code is probably good enough. Otherwise, $50 for the developer guide is a pretty good bargain.
我在多个项目中使用JFreeChart取得了成功。它是非常可配置的。JFreeChart 是开源的,但他们对开发者指南收费。如果您正在做一些简单的事情,示例代码可能就足够了。否则,开发人员指南的 50 美元是非常划算的。
With respect to "real-time" data, I've also used JFreeChart for these sorts of applications. Unfortunately, I had to create some custom data models with appropriate synchronization mechanisms to avoid race conditions. However, it wasn't terribly difficult and JFreeChart would still be my first choice. However, as the FAQ suggests, JFreeChart might not give you the best performance if that is a big concern.
关于“实时”数据,我也将 JFreeChart 用于这些类型的应用程序。不幸的是,我不得不使用适当的同步机制创建一些自定义数据模型以避免竞争条件。然而,这并不是特别困难,而且 JFreeChart 仍然是我的首选。但是,正如常见问题解答所建议的那样,如果这是一个大问题,JFreeChart 可能不会为您提供最佳性能。
回答by Chris Farmer
I used JFreeChart (http://www.jfree.org/jfreechart/) on a previous project. It has some very good built-in capabilities, and the design was WAY extensible so you could always roll your own extension later if you needed some custom chart annotation or wanted an axis to render differently, or whatever. It's definitely worth checking out.
我在以前的项目中使用了 JFreeChart ( http://www.jfree.org/jfreechart/)。它有一些非常好的内置功能,而且设计是可扩展的,所以如果你需要一些自定义图表注释或想要一个轴以不同的方式呈现,或者其他什么,你可以随时滚动你自己的扩展。绝对值得一试。
回答by cringe
I've used JFreeChartin a rather complex application that needed to visualize data streams and calculations based on the data. We implemented the ability to visually edit the data plots by mouse and had a very large set of data points. JFreeChart handled it very well.
我在一个相当复杂的应用程序中使用了JFreeChart,该应用程序需要可视化数据流和基于数据的计算。我们实现了通过鼠标可视化编辑数据图的能力,并拥有非常大的数据点集。JFreeChart 处理得很好。
Unfortunately I was stuck with v0.7, but the newest release are sooo much better when it comes to API clarity. The community is very helpful and the developers are responding to mails too.
不幸的是,我坚持使用 v0.7,但在 API 清晰度方面,最新版本要好得多。社区非常有帮助,开发人员也在回复邮件。
If you're doing a web application and don't want to bother with libraries, you can check the Google Chart API. Didn't use it myself, but I started some tests which were very promising.
如果您正在开发 Web 应用程序并且不想打扰库,您可以查看Google Chart API。我自己没有使用它,但我开始了一些非常有希望的测试。
回答by ddimitrov
回答by ddimitrov
For real-time plotting you can use QN Plot, JOpenChart or its fork Openchart2.
对于实时绘图,您可以使用 QN Plot、JOpenChart 或其分支 Openchart2。
回答by Adam Davis
JHandles is an alternative graphics package for Octave (a math package). It is probably worth looking into, but being Octave specific may not have what you need.
JHandles 是 Octave 的替代图形包(一个数学包)。这可能值得研究,但特定于 Octave 的可能不具备您所需要的。
-Adam
-亚当
回答by Jacek ?awrynowicz
Live Graphsupports real-time rendering.
Live Graph支持实时渲染。
回答by Jason S
I just ran into a similar issue (displaying fast-updating data for engineering purposes), and I'm using JChart2D. It's pretty minimalist and has a few quirks but it seems fairly fast: I'm running a benchmark speed test where it's adding 2331 points per second (333x7 traces) to a strip chart and uses 1% of the CPU on my 3GHz Pentium 4.
我刚刚遇到了类似的问题(出于工程目的显示快速更新的数据),我正在使用JChart2D。它非常简约,有一些怪癖,但似乎相当快:我正在运行一个基准速度测试,它将每秒 2331 点(333x7 轨迹)添加到条形图,并在我的 3GHz Pentium 4 上使用 1% 的 CPU。
回答by Tim
You might want to check out JMathPlot
你可能想看看 JMathPlot