Combined Gantt Chart?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Combined Gantt Chart?

Post by eriktamu » Tue Jun 12, 2007 2:36 pm

I would like to create a combined gantt chart that would have all of the date ranges for the domain axis, like we have for gantt. I haven't found a way to do this. I've tried CombinedDomainCategory, but I can find a way to put in a DateAxis for the domain.

Any ideas? :(

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Jun 12, 2007 3:55 pm

It's not that clear to me what you are trying to achieve, but since the Gantt chart plots dates against the range axis, perhaps you could try CombinedRangeCategoryPlot?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Tue Jun 12, 2007 4:24 pm

David,

This is what I'm trying to do. I started off with a gantt chart with 1 series. That's fine, the height of each task is sufficient. I then added two other series and the blocks become quite small. I have tried changing margins and everything else, but nothing seems to work.

I then decided to try and use a combined chart as it wouldn't hurt what I was trying to do and then would also (I hoped) make the height of each task bigger. But trying to do this has seemed even more difficult.

When I tried the CombinedRangeCategoryPlot, everything flips vertical and the tasks aren't lining up correctly.

I can send you some images if that would help, but I would have to email them to you.

Thanks![/img]

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Jun 12, 2007 4:30 pm

OK, it just sounds like you are running out of space for all the bars. Switching to a CombinedRangeCategoryPlot won't fix that. About all you can do is make your chart taller (for example, if it is displayed in a ChartPanel, you can embed the ChartPanel in a JScrollPane and set the preferred size to some suitable value).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Tue Jun 12, 2007 7:28 pm

The height of the bars are very small. There is about 5X the amount of space between the bars as the actual height of the bar itself. I was thinking that it might be saving room for the other series. None of my series have elements in them named the same. I don't have a task named MyName in multiple series. Each task has a distinct name.

I have 14 bars and the chart height is 600 pixels. If I increase the height it doesn't seem to make much of a difference. I had originally set it at 500 and when changed to 600, I can see no real difference in the output.

With 1 series (bars are plenty tall):

Image

With 2 additional series (bars seem too short despite chart size):

Image

salase
Posts: 4
Joined: Tue Jun 12, 2007 10:23 pm

eric could you please post your code?

Post by salase » Wed Jun 13, 2007 7:42 pm

Hello,
I'm trying to do a similar Gantt chart would you mind posting your code?
Also where your results exported to i mean to excel,PDF?

following is from my post:-
The report needs to be displayed in Excel and it should look like project management tool.

Following is an example of the data how it should look like:-
(dotted lines indicate horizontal bar)two bars for each record one to represent planned and another to represent actual.
header information of the dates is dynamic.





Code: Select all

planduration actualdurtion   1/1/2007    1/2/2007     1/3/2007   1/4/2007
  3                   1                 --------------------------------------
                                        -----------             
  2                   3                 -----------------------
                                         --------------------------------------


I would appreciate if there are any examples on how to achieve this would be great too!




any thoughts are appreciated.

Thanks,
Srilatha.

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Wed Jun 13, 2007 9:10 pm

My code results in a png file that is displayed in a website. I have no knowledge on exporting the chart to excel.

That being said, have you been able to view the JFreeChart demo which can found as a link here:

http://www.jfree.org/jfreechart/

If you look at the Gantt demos you will probably find one that pretty much matches what you are looking for. Also, if you pay the author of the code for his documentation, you'll also receive the source code for his demo which would pretty much give you line for line what you would need to produce the chart. And the cost is very reasonable.

salase
Posts: 4
Joined: Tue Jun 12, 2007 10:23 pm

have one more question

Post by salase » Wed Jun 13, 2007 10:40 pm

Eric,
thank your for replying back and also for your suggestion.
In the first place, is it achievable what I'm planning to do using JFree chart?

My be I need data in excel format and "somehow" paint the bars horizontally
according to the headers.

i'm still debating to do everything in an image format as Gantt but even this can be achieved in the first place or not is the question.Since my report has data and also the Gantt.

would appreciate any thoughts..

thanks!
Srilatha.

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Thu Jun 14, 2007 4:53 am

Srilatha,

I'm not exactly sure what you are trying to do. JFreeChart is a library of java classes designed to create charts-on-the fly from data. The primary uses of it would either be in a java application or a java web application. I don't use excel at all really, but I can imagine that with the correct set of data you could create a gantt chart within the excel application with 3rd-party extensions at worst case.

So if you're asking could this java library create a chart in excel, it probably isn't what you're looking for.

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Thu Jun 14, 2007 3:55 pm

Any thoughts on how I could make these bars thicker?

eriktamu
Posts: 12
Joined: Thu Nov 11, 2004 11:32 pm
Location: Austin, TX
Contact:

Post by eriktamu » Mon Jun 18, 2007 7:01 pm

To whomever is interested. I have achieved my desired results. I used a combined range axis like David mentioned, but just changed the orientation (DUH!). Oh well. At least Monday is going well for me so far. I'll attach the latest image to get everyone and idea of what I was trying to get.

Image

MNusinov
Posts: 15
Joined: Tue Jul 03, 2007 7:41 pm

Post by MNusinov » Mon Jul 30, 2007 9:24 pm

Is that Today bar part of your Gantt Chart? Is there a simple way to draw that on the Gantt Chart?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Jul 31, 2007 10:41 am

The "Today" line will be a range marker on each subplot (look for the addRangeMarker() method in the plot classes).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

zmonster
Posts: 4
Joined: Sat Mar 06, 2004 12:56 am

Post by zmonster » Wed Sep 05, 2007 3:52 am

Imagine if the 'Today' line in the previous posted example graph were a 'Due Date' vertical line added to each category via a LevelRenderer. What is the best/easiest way to draw the gantt series bars in a different (overdue) color if the given bar is past the LevelRenderer 'overdue' vertical line?

Note that I would want the part of the bar PRIOR to the 'Due Date' line to be the 'normal color', and the rest of the bar AFTER the 'Due Date' line in the 'overdue' (i.e. alarm) color...

roxyjsr
Posts: 1
Joined: Thu Nov 22, 2007 6:58 am
Contact:

How to color the task in Jfree.

Post by roxyjsr » Thu Nov 22, 2007 7:11 am

Hi,
I m very new to Jfree. I am trying to create a Gantt chart using Jfree. While displaying the Chart thru my JSF , I m using Cewolf , a 3rd party library. When I am displaying the chart it displays correctly but color is same is all task(i think it is default color, Red).

So any one can assist me how to put different color for difft Task.


Waiting for reply.

Thanks

Locked