hi, anyone can share a Gantt sample,the sample in demo is not enough,too sample. I saw the topic "the index of subitem",but it is only a part of source,can anyone share the complete sample source include:how to set the color ,url and tips of subtask? thanks a lot.
my mail: princeahan_wang@hotmail.com
who can share Gantt sample
Here you are:
Code: Select all
JFreeChart chart = ChartFactory.createGanttChart("xxx", "", null, taskseriescollection, false, true, false);
chart.setBorderVisible(false);
chart.setBackgroundPaint(new Color(255, 255, 255));
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
MyGanttRenderer renderer = new MyGanttRenderer();
plot.setRenderer(renderer);
renderer.setMaxBarWidth(0.1); //prevent very thick bar when only one task
CategoryURLGenerator generator = new MyStandardCategoryURLGenerator(xId);
renderer.setItemURLGenerator(generator);
renderer.setBaseToolTipGenerator(new IntervalCategoryToolTipGenerator("{3} - {4}", DateFormat.getDateInstance()));
TextTitle textTitle = chart.getTitle();
textTitle.setPosition(RectangleEdge.TOP);
...
public class MyGanttRenderer extends GanttRenderer {
public MyGanttRenderer() {
super();
}
public Paint getItemPaint(int row, int column) {
return DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[column];
}
}
public class MyStandardCategoryURLGenerator implements CategoryURLGenerator {
int xId;
public MyStandardCategoryURLGenerator(int xId) {
this.xId = xId;
}
public String generateURL(CategoryDataset data, int series, int category) {
...
}
Hi,
can share a Gantt sample.
I am student and I need sample who using Gantt Chart.
Thanks
my mail: mztbardo@freesurf.fr
can share a Gantt sample.
I am student and I need sample who using Gantt Chart.
Thanks
my mail: mztbardo@freesurf.fr