欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
不同任務(wù)采用不同顏色
 
import java.awt.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.renderer.category.*;
import org.jfree.data.category.*;
import org.jfree.data.gantt.*;
import org.jfree.ui.*;
public class GanttDemo2 extends ApplicationFrame {
/**
* Creates a new demo.
*
* @param title the frame title.
*/
public GanttDemo2(String title) {
super(title);
IntervalCategoryDataset dataset = createDataset();
JFreeChart chart = createChart(dataset);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(800, 570));
setContentPane(chartPanel);
}
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return A sample chart.
*/
private static JFreeChart createChart(IntervalCategoryDataset dataset) {
JFreeChart chart = ChartFactory.createGanttChart(
"Gantt Chart Demo", // chart title
"Task", // domain axis label
"Date", // range axis label
dataset, // data
true, // include legend
true, // tooltips
false // urls
);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setAxisOffset(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
plot.setDomainGridlinePosition(CategoryAnchor.END);
plot.setDomainGridlinesVisible(true);
// CategoryItemRenderer renderer = plot.getRenderer();
// renderer.setSeriesPaint(0, Color.blue);
GanttRenderer renderer = new CustomRenderer();
plot.setRenderer(renderer);
FileOutputStream fos_jpg = null;
try {
fos_jpg = new FileOutputStream("D:\\test.jpg");
ChartUtilities.writeChartAsJPEG(fos_jpg, 1, chart, 500, 400, null);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fos_jpg.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return chart;
}
static class CustomRenderer extends GanttRenderer {
/** The colors. */
private Paint[] colors;
/**
* Creates a new renderer.
*
* @param colors the colors.
*/
public CustomRenderer() {
this.colors = colors;
}
/**
* Returns the paint for an item. Overrides the default behaviour
* inherited from AbstractSeriesRenderer.
*
* @param row the series.
* @param column the category.
*
* @return The item color.
*/
public Paint getItemPaint(int row, int column) {
if(column % 2 == 0){
setCompletePaint(Color.pink);
return Color.blue;
}else{
setCompletePaint(Color.blue);
return Color.pink;
}
}
}

/**
* Creates a sample dataset for a Gantt chart, using sub-tasks. In
* general, you won't hard-code the dataset in this way - it's done here so
* that the demo is self-contained.
*
* @return The dataset.
*/
private static IntervalCategoryDataset createDataset() {
TaskSeries s1 = new TaskSeries("Scheduled");
Task t1 = new Task(
"Write Proposal",
date(1, Calendar.APRIL, 2001), date(5, Calendar.APRIL, 2001)
);
t1.setPercentComplete(1.00);
s1.add(t1);
Task t2 = new Task(
"Obtain Approval",
date(9, Calendar.APRIL, 2001), date(9, Calendar.APRIL, 2001)
);
t2.setPercentComplete(1.00);
s1.add(t2);
// here is a task split into two subtasks...
Task t3 = new Task(
"Requirements Analysis",
date(10, Calendar.APRIL, 2001), date(5, Calendar.MAY, 2001)
);
Task st31 = new Task(
"Requirements 1",
date(10, Calendar.APRIL, 2001), date(25, Calendar.APRIL, 2001)
);
st31.setPercentComplete(1.0);
Task st32 = new Task(
"Requirements 2",
date(1, Calendar.MAY, 2001), date(5, Calendar.MAY, 2001)
);
st32.setPercentComplete(1.0);
t3.addSubtask(st31);
t3.addSubtask(st32);
s1.add(t3);
// and another...
Task t4 = new Task(
"Design Phase",
date(6, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001)
);
Task st41 = new Task(
"Design 1",
date(6, Calendar.MAY, 2001), date(10, Calendar.MAY, 2001)
);
st41.setPercentComplete(1.0);
Task st42 = new Task(
"Design 2",
date(15, Calendar.MAY, 2001), date(20, Calendar.MAY, 2001)
);
st42.setPercentComplete(1.0);
Task st43 = new Task(
"Design 3",
date(23, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001)
);
st43.setPercentComplete(0.50);
t4.addSubtask(st41);
t4.addSubtask(st42);
t4.addSubtask(st43);
s1.add(t4);
Task t5 = new Task(
"Design Signoff",
date(2, Calendar.JUNE, 2001), date(2, Calendar.JUNE, 2001)
);
s1.add(t5);
Task t6 = new Task(
"Alpha Implementation",
date(3, Calendar.JUNE, 2001), date(31, Calendar.JULY, 2001)
);
t6.setPercentComplete(0.60);
s1.add(t6);
Task t7 = new Task(
"Design Review",
date(1, Calendar.AUGUST, 2001), date(8, Calendar.AUGUST, 2001)
);
t7.setPercentComplete(0.0);
s1.add(t7);
Task t8 = new Task(
"Revised Design Signoff",
date(10, Calendar.AUGUST, 2001), date(10, Calendar.AUGUST, 2001)
);
t8.setPercentComplete(0.0);
s1.add(t8);
Task t9 = new Task(
"Beta Implementation",
date(12, Calendar.AUGUST, 2001), date(12, Calendar.SEPTEMBER, 2001)
);
t9.setPercentComplete(0.0);
s1.add(t9);
Task t10 = new Task(
"Testing",
date(13, Calendar.SEPTEMBER, 2001), date(31, Calendar.OCTOBER, 2001)
);
t10.setPercentComplete(0.0);
s1.add(t10);
Task t11 = new Task(
"Final Implementation",
date(1, Calendar.NOVEMBER, 2001), date(15, Calendar.NOVEMBER, 2001)
);
t11.setPercentComplete(0.0);
s1.add(t11);
Task t12 = new Task(
"Signoff",
date(28, Calendar.NOVEMBER, 2001), date(30, Calendar.NOVEMBER, 2001)
);
t12.setPercentComplete(0.0);
s1.add(t12);
TaskSeriesCollection collection = new TaskSeriesCollection();
collection.add(s1);
return collection;
}
/**
* Utility method for creating <code>Date</code> objects.
*
* @param day the date.
* @param month the month.
* @param year the year.
*
* @return A date.
*/
private static Date date(int day, int month, int year) {
Calendar calendar = Calendar.getInstance();
calendar.set(year, month, day);
Date result = calendar.getTime();
return result;
}
/**
* Creates a panel for the demo (used by SuperDemo.java).
*
* @return A panel.
*/
public static JPanel createDemoPanel() {
JFreeChart chart = createChart(createDataset());
return new ChartPanel(chart);
}
/**
* Starting point for the demonstration application.
*
* @param args ignored.
*/
public static void main(String[] args) {
GanttDemo2 demo = new GanttDemo2("Gantt Chart Demo 2");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}
}
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
jfreechart形成各種圖
JFreeChart -- 柱狀圖
JFreeChart在JSP中的應用實(shí)例
餅圖制作 - jfreechart - 黎聲的博客
JFreeChart柱狀圖3D多色百分比JSP輸出JPG代碼
jfreechart畫(huà)復合圖(混合圖)已做亂碼處理
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久