以编程方式创建饼图 [英] Creating pie charts programmatically

查看:84
本文介绍了以编程方式创建饼图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Java中以编程方式生成饼图?我有一些程序处理的数据,然后我想创建一个具有饼图的图像文件(PNG,GIF等).是否有执行此操作的库,或者至少可以用来执行此操作的库?

或者,使用在JFrame中绘制饼图然后以某种方式自动将其截屏的库会更好吗?

解决方案

JFreeChart 可以生成饼图可以将结果图表保存为JPEG格式.这是一个示例操作方法.这是 3D示例.

开发人员指南中提供了更多示例和文档.. >

其他生成饼图的图表库:

How can I programmatically generate pie charts from java? I have some data that is processed by a program, then I want to create an image file (PNG, GIF, etc) that has a pie chart. Is there a library that does this, or at least which I can use to do this?

Alternately, would it be better to use a library that will draw pie charts in a JFrame and then somehow automatically screenshot those?

解决方案

JFreeChart can generate pie charts and can save the resultant chart to JPEG format. Here is an example of how to do so. Here is a 3D example.

There are more examples and documentation available in the developers guide.

Other charting libraries which generate piecharts:

这篇关于以编程方式创建饼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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