SWT 中漂亮图表的库? [英] Libraries for pretty charts in SWT?

查看:25
本文介绍了SWT 中漂亮图表的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道以下用于在 SWT/Eclipse RCP 应用程序中绘制图表的库:

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

还有哪些其他库可以使用 SWT 绘制漂亮的图表?或者Java中的图表一般?毕竟,您始终可以显示图像...

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

推荐答案

我没有使用过 BIRT 或 JGraph,但是我在我的 SWT 应用程序中使用了 JFreeChart.我发现在 SWT 中使用 JFreeChart 的最佳方法是制作一个复合 AWT 框架并使用 JFreeChart 的 AWT 功能.这样做的方法是创建一个复合

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);

在跨平台实现方面存在几个问题,并且其中的 SWT 代码非常糟糕(在辩护中,Gilbert 先生不太了解 SWT,它是为 AWT 编写的).我的两个最大问题是,当 AWT 事件通过 SWT 冒泡时,会触发一些错误事件,并且由于包装 AWT 框架,JFreeChart 变得非常慢.

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

将图表放入网页的想法可能不是一个好方法.首先存在几个问题,即 Eclipse 处理在不同平台上集成 Web 浏览器的方式不一致.此外,根据我对一些用于 Web 的图形包的理解,它们是服务器端需要该设置的,包括我在内的许多公司也使用代理服务器,有时这会导致 Eclipse 网络浏览出现问题.

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.

这篇关于SWT 中漂亮图表的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆