http://blog.sina.com.cn/s/blog_50a7c4a601009817.html
第一种方法使用SwiftGantt实现甘特图(进度图推荐这个)
import java.awt.Color;
import java.io.IOException;
import java.util.GregorianCalendar;
import com.yuxingwang.gantt.Config;
import com.yuxingwang.gantt.GanttChart;
import com.yuxingwang.gantt.model.GanttModel;
import com.yuxingwang.gantt.model.Task;
import com.yuxingwang.gantt.ui.TimeUnit;
public class SwiftGanttChartDemo {
public static void main(String[] args) throws IOException{
//1. 首先初始化一个甘特图的主类com.yuxingwang.gantt.GanttChart,
//是一个继承自javax.swing.JScrollPanel的Swing的组件,通过它就可以用来显示甘特图:
GanttChart gantt = new GanttChart();
//2. 设置甘特图的时间刻度的单位,如以星期为单位,则时间轴上的每一刻度代表一个星期:
gantt.setTimeUnit(TimeUnit.Day);
//3. 配置甘特图,在这里您可以通过Config类配置您的甘特图,
//您可以设置甘特图各个元素的颜色,宽度等,详细配置项请参考API文档中的Config类的说明。
//Config config = gantt.getConfig();
//config.setWorkingTimeBackColor(Color.red);
//4. 创建甘特图的数据模型GanttModel,
//所有的您要显示的项目任务信息都通过GanttModel来提供给GanttChart对象。
GanttModel model = new GanttModel();
//5. 设置项目开始时间和结束时间:
model.setKickoffTime(new Gr