Gantt charts: labels not lining up with task bars (v1.0 rc1)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nsequeira
Posts: 10
Joined: Fri Apr 11, 2003 9:20 pm

Gantt charts: labels not lining up with task bars (v1.0 rc1)

Post by nsequeira » Tue Jul 26, 2005 9:26 pm

So here's another problem I'm having with Gantt charts. I have a data set with three TaskSeries, each containing tasks with multiple levels of sub-tasks. The sub-tasks are not getting rendered (but I already submitted a post about that), but if you look at my graph, it's clear that the labels on the left are not lining up with their associated bars.

Image



Any ideas? Thanks.

-- Nathan[/img]

doofusLARGE
Posts: 11
Joined: Thu Jul 07, 2005 7:40 pm

Post by doofusLARGE » Wed Jul 27, 2005 4:25 pm

Yes, I've noticed this too. What I've done (which was quite a bit of work and included other things) was to get rid of the verticle axis labels, and to directly include the labels in the bar itself.

BigWillyStyle42
Posts: 58
Joined: Wed Jun 02, 2004 1:37 pm

Post by BigWillyStyle42 » Wed Jul 27, 2005 6:50 pm

Since you have 3 series there can be 3 bars associated with each label. If you look at your blue bars they appear exactly inline with the label while the green bars are slightly above and the red are slightly below. That is infact exactly how a GanttChart should appear.

Craig

Post by Craig » Wed Aug 24, 2005 6:38 pm

I'm using a Gantt chart and I have this same problem. I can guarantee that there will onbly be one bar at a time per label. Is there a way to move all the bars directly to the center?

Guest

Post by Guest » Wed Aug 24, 2005 6:59 pm

What I eventually discovered was that I was doing this wrong. I was using multiple TaskSeries objects for my data when it didn't actually make sense to do so. You should use multiple TaskSeries objects when you want to show different data for the SAME TASK. If you look at GanttDemo1, you'll notice that there are two TaskSeries objects used representing "Scheduled" and "Actual" data. These TaskSeries objects have identical task lists, just with different durations.

You'll notice that in the graph, the "Scheduled" bar is just above the "Actual" bar for each task. Neither is quite centered on the task label, but that's the way it's supposed to be.

This was my mistake. I was using multiple TaskSeries objects when I only needed to use one for my data set. If you use one TaskSeries object, the bars will all be centered on the task label.

Craig

Post by Craig » Thu Aug 25, 2005 6:39 pm

I know that I probably shouldn't be using multiple TaskSeries...but at the same time I'm not sure if I can get away with not using them. My graph is this:

Image

I'm afraid of switching to one TaskSeries because then I will lose my legend and colors. Maybe I'll need to do a custom legend and renderer...But if you know how to make all of these bars line up on the center w/ their conveyance, that would be extremely helpful.
Craig

Locked