1

If I put all my tasks into a single TaskSeries, I get normally sized Gantt chart bars, but when I take those same tasks, put them into multiple TaskSeries, it makes really skinny bars. Is this a bug, or am I doing it wrong?

enter image description here Right clicking and 'view image', you can read the code.

Dale
  • 5,520
  • 4
  • 43
  • 79
  • I am unable to [reproduce](http://stackoverflow.com/a/8949913/230513) the effect you illustrate. Please edit your question to include an [sscce](http://sscce.org/) that exhibits the problem. – trashgod Jun 21 '12 at 03:42

1 Answers1

4

I don't have a solution but this may help you find one.

In your second example, JFreeChart is allowing space in each task (y axis) for each task series; the bar width is the available space / number of task series. Hopefully this illustration helps:

enter image description here

In (A) I have created 6 tasks, but only one job; and in (B) I have created a second job and attached 3 Tasks to it. In (B) the bars are roughly half as wide, so that there is space for both jobs in all tasks. In (D) you can see that, as I have moved one of the tasks. You can thicken the bars as mush as possible using this code:

  plot.getDomainAxis().setCategoryMargin(0.05);
  plot.getDomainAxis().setLowerMargin(0.05);
  plot.getDomainAxis().setUpperMargin(0.05);
  GanttRenderer renderer = (GanttRenderer) plot.getRenderer();
  renderer.setItemMargin(0);

This thread on the JFreeChart board may shed some further light on the issue.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
GrahamA
  • 5,875
  • 29
  • 39