Skip to main content

Gantt chart component

16 replies [Last post]
Anonymous

Yes I know, there are lots of Gantt chart components. But I couldn't find
anyone that suited my needs.
I want something that's Royalty free (I don't mind paying for a good
component but I'd like to see the API and try it first).
I want something that follows the guidelines of Swing and doesn't have a
large and complicated API but rather a limited yet highly extensible
architecture like JTable.
I did find one cool component where JTable was used to create a Gantt chart
but the API seemed awkward and not quite what I was looking for.

Our needs are relatively limited so I just started writing something using
the well known Swing concepts i.e. Model, abstract model, renderer, default
renderer, plaf, model listener and event class. I'd also like to have
adapters for table models.

I'd be happy to contribute something basic (i.e. fitting my needs but
reasonably extensible) to the project if there is any chance of getting it
into the swingx source.
Is this something people want/need besides myself?
If so, what type of features would you expect? How do you see the model?

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kalyan Vaidyanathan

Hi,
The code I have is not sophisticated enough and packaged enough, but am
willing to contribute it if you want to start an open source project around
it. I believe the ganttHeaderComponent that I have will be a nice addition
to the basic gantt component that Shai has created. Once the two are
integrated, then we can add features around print/zoom/pan etc.

thanks and regards,
-kalyan
[att1.html]

Shai Almog

I doubt whether my stuff can be integrated with anything since I created
something complete from scratch that derives from JComponent and sits on top
of a model (with renderers/editors for entities within the gantt). Currently
this draws nothing due to a ridiculous amount of bugs on my part :-(
I was working on it a bit over weekends but now with my new Jasper20 phone
I'm working more on a CDC port of our application to JSR 209 (which is hell
as I wrote in a previous post). So the gantt work isn't really progressing
right now, if there is a large interest and several people are willing to
push an effort then I'll probably put some work into it and get something
basic working so we can go on from there but this will probably take at
least a months work just to get something simple running!

--
Shai Almog
vPrise
http://www.vprise.com/
[att1.html]

rbair
Offline
Joined: 2003-07-08
Points: 0

Actually, Romain and I were looking at creating a tool to help describe animations from timingframework.dev.java.net. It would be in essense a gantt-chart like component (with all the mouse dragging etc). I don't know if in the end there would be that much overlap, but it would be interesting to see.

As usual, the code would all go in the incubator first.

Cheers
Richard

Shai Almog

Interesting :-)
Unfortunately I have to duplicate your work since I need to get this thing
done.
I won't be checking this in to anywhere since just getting the code to the
form where its ready for contribution is some work and there is no point of
checking in something for which there is no interest... If no one in this
forum needs this then I'll just keep this work private rather than add yet
another framework to confuse people.

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]

jetbrains
Offline
Joined: 2005-12-15
Points: 0

Jfreechart is Royalty free and open source
Freepiechart4j is free but not open source

http://www.developerzone.biz/index.php?option=com_content&task=view&id=3...

Shai Almog

If I remember correctly JFreeChart doesn't have proper user modifiable
gantt's, am I correct in this assessment?
There are quite a few free Gantt components as well as a few good
proprietary Gantt components, its all a matter of budget and personal taste
in the architecture of the component.

--
Shai Almog
vPrise
http://www.vprise.com/
[att1.html]

Kalyan Vaidyanathan

Hi,
My experience was similar to yours in that even though there were lots of
gantt components there was not one simple to use and easy to extract. So, I
ended up developing something on my own too. It is built on top of the
JXTreeTable with a ganttCellRenderer and a ganttHeaderRenderer to do the
rendering. I have a small feature list that I'd like to add to mine, but if
we can pool then maybe it will both.

let me know,
thanks and regards,
-kalyan

On 3/9/06, Shai Almog wrote:
>
> Yes I know, there are lots of Gantt chart components. But I couldn't find
> anyone that suited my needs.
> I want something that's Royalty free (I don't mind paying for a good
> component but I'd like to see the API and try it first).
> I want something that follows the guidelines of Swing and doesn't have a
> large and complicated API but rather a limited yet highly extensible
> architecture like JTable.
> I did find one cool component where JTable was used to create a Gantt
> chart but the API seemed awkward and not quite what I was looking for.
>
> Our needs are relatively limited so I just started writing something using
> the well known Swing concepts i.e. Model, abstract model, renderer,
> default renderer, plaf, model listener and event class. I'd also like to
> have adapters for table models.
>
> I'd be happy to contribute something basic (i.e. fitting my needs but
> reasonably extensible) to the project if there is any chance of getting it
> into the swingx source.
> Is this something people want/need besides myself?
> If so, what type of features would you expect? How do you see the model?
>
> --
> Shai Almog
> vPrise Consulting
> http://www.vprise.com/
>
[att1.html]

Shai Almog

Kalyan,
its good to see that I'm not the only one. I looked at implementing the
Gantt on top of the JTable component which should be similar but rejected
this approach (one of the other gantt components did it, the name escapes me
at the moment). This is somewhat limiting to me mostly in the form of
forcing column mentality and limited support for zooming, my current
approach is very ambitious so it should be possible to implement any feature
with this code base.
Can you list a general set of features so I can verify that the code will be
able to support them?

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]

Kalyan Vaidyanathan

Hi,
Here is my current desire:
1. Ability to have a few data columns on the left and a gantt column on the
right. The data rows might have various data types displayed like date,
boolean, indicator, integer, double, string, etc. each with an editable
options
2. Ability to have a hierarchical display of the records on the left
3. Two header rows for the gantt cell (major and minor time axis)
4. Ability to display "today"
5. Ability to display weekends/holidays
6. Ability to display tasks, and more than one in each row
7. Ability to customize the task color, fill pattern, border
8. Ability to have a multi-line tool tip on the gantt header(s), tasks
9. Ability to display precedence arrows to show relationships between tasks
10. Zoom and pan on the gantt display
11. Dynamically update the gantt display on change of data on the left data
portion
12. Ability to define the precedence relationships by drag and drop of
relationships
13. Ability to highlight a row (selected row highlighter and roll over
highlighter type functionality)
14. Sort/filter capabilities on the data portion on the left
15. Ability to put the entire gantt component into a JPanel and locate it
within a JFrame

that's about all i can think of now.

thx,
-kalyan
[att1.html]

Shai Almog

Hi Kalyan,
thanks for the detailed response. Some of these things illustrate the great
difference between the approach I took and whats "out there".

1. Ability to have a few data columns on the left and a gantt column on the
> right. The data rows might have various data types displayed like date,
> boolean, indicator, integer, double, string, etc. each with an editable
> options
>

I don't think a data column will be very practical here since this is more
appropriate for table behavior. Also the left side will only be used for
left to right languages.
The basic Gantt component won't have anything on its side but I want to have
an advanced component that will allow a JComponent to be synchronized with
the gantts scrolling (this isn't implemented yet) so a JTable/JList or JTree
can be used as the side component and can be manipulated in the same way
they always are thus reusing existing Swing code.

2. Ability to have a hierarchical display of the records on the left
>

I assume this will be achieved with a JTree component on the side, right?

3. Two header rows for the gantt cell (major and minor time axis)
>

I want to have a GanttChartHeader component just like the table header with
its own renderer. This will allow that sort of functionality for those who
desire it.
My thoughts are about the model header content approach, in TableModel the
header is quite simple:
getColumnCount(), getColumnName()

However, in the gantt we can have a level of zoom and there are no columns
(at least not in my approach to gantt which is one of the things I disliked
about other gantts).
So my current approach is to get the units according to the zoom level so if
we are talking about a gantt related to time the more you zoom in/out you
will get finer/coarser units of time such as years, months, days, hours,
minutes and seconds...
How should this be represented by the gantt?
My current approch is to give the method all the details and get "tick
count" which would indicate the unit type (and will allow to draw ticks on
the ruler on top):
/**
* Will return the number for which a tick should be drawn
*/
double getTickCount(double zoom);

/**
* Returns the number of ticks that should pass in order for a label to be
drawn
*/
double getTicksPerLabel(double zoom);

/**
* Returns the label for the given tick
*/
String getLabel(double zoom, double tick);

Now this model approach won't support by default two header rows like you
described, but my purpose is to make the simplest use case simple and the
harder use case possible just like JTable. In as far as I can see this is
the closest I can get to matching the JTable functionality.

4. Ability to display "today"
>

I'm designing the gantt chart around the concept of a set of double numbers
within a virtual space. It doesn't know about dates or time although I'm
considering an abstraction that will know about these things since this is
the most common use case. When I will create such an abstraction I will add
these features :-)

5. Ability to display weekends/holidays
>

This is very difficult though, I'm thinking about an additional model.

6. Ability to display tasks, and more than one in each row
>

I have that.

7. Ability to customize the task color, fill pattern, border
>

There is a cell renderer that you can replace and render the task in any way
you like... This was one of the most important features for me...

8. Ability to have a multi-line tool tip on the gantt header(s), tasks
>

I'm using the cell renderer tooltip text. If its an HTML tooltip this
should work perfectly.

9. Ability to display precedence arrows to show relationships between tasks
>

Right now I didn't implement arrows at all since I don't need them for our
beta release. I will probably need to add them though...

10. Zoom and pan on the gantt display
>

Both are implemented and very generic.

11. Dynamically update the gantt display on change of data on the left data
> portion
>

When the data is changed the gantt model needs to fire the event to update
the view. When you change the left data you need to update the gantt model
appropriately and everything should work just like a JTable.

12. Ability to define the precedence relationships by drag and drop of
> relationships
>

I don't have any concept of relationships right now, I will probably need
to add this into the model. Does 1-1 relationship suffice or is there a
1-many relationship as well in your gantts?

13. Ability to highlight a row (selected row highlighter and roll over
> highlighter type functionality)
>

I probably won't have this for the first release, although from the code
this seems to be very simple to implement.

14. Sort/filter capabilities on the data portion on the left
>

The data portion will support the sorting of the component (such as
JXTable).
Up until now I was thinking of the model as the point of implementing this
sort of functionality but now I'm having second thoughts. After all the
table accesses the model through a point that allows sorting on the view
side and the gantt should probably do the same.

15. Ability to put the entire gantt component into a JPanel and locate it
> within a JFrame
>

I require a JScrollPane to be placed around the Gantt, its just not
practical otherwise there is no other constraint about the gantt other than
the basic need to have a model :-)

Thanks for the great feedback!
Even though as it appears there is no point to contribute this (no
interest), if you would like I can send you my code for personal use.

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]

hyrth
Offline
Joined: 2005-02-14
Points: 0

Hi Shai, Hi Kalyan,

I am facing the same problem as you did - we need a Java Gantt Component that is editable and simple to use, so a user can easily setup and change time period - object relations.
The Gantt Project is kind of too heavyweight for our purpose and the JFreeChart is not editable.

would you mind to send us your code? Or do you know a new open source project that covers most of the requested features.

Regards,

Hrvoje Mustapic

Shai Almog

Hi Hrvoje,
to be honest everything slowed down for us here after the initial release
and many priorities changed, while a nice editable Gantt would definitely be
great if it was available we just didn't have the resources to reinvent one,
so there is some code but its in no shape or form and you would be better
off starting from scratch right now.

If I'll do some work on it I'll send a heads up for the list but right now
there are so many other things going on this is wayyyy down in the priority
list...

--
Shai Almog
vPrise
http://www.vprise.com/
[att1.html]

Frederic Lavigne

Hi Shai,

Can you enumerate the list of chart components you already look at?

As example there is this GanttProject project
(http://ganttproject.sourceforge.net/) which has a gantt chart
(http://ganttproject.sourceforge.net/pictures-2.0/ScreenShot11.png) and is
GPL licensed. Maybe it can be extracted?

-fred

_____

From: Shai Almog [mailto:shai.almog@gmail.com]
Sent: Thursday, March 09, 2006 3:09 PM
To: jdnc@jdnc.dev.java.net
Subject: Gantt chart component

Yes I know, there are lots of Gantt chart components. But I couldn't find
anyone that suited my needs.
I want something that's Royalty free (I don't mind paying for a good
component but I'd like to see the API and try it first).
I want something that follows the guidelines of Swing and doesn't have a
large and complicated API but rather a limited yet highly extensible
architecture like JTable.
I did find one cool component where JTable was used to create a Gantt chart
but the API seemed awkward and not quite what I was looking for.

Our needs are relatively limited so I just started writing something using
the well known Swing concepts i.e. Model, abstract model, renderer, default
renderer, plaf, model listener and event class. I'd also like to have
adapters for table models.

I'd be happy to contribute something basic (i.e. fitting my needs but
reasonably extensible) to the project if there is any chance of getting it
into the swingx source.
Is this something people want/need besides myself?
If so, what type of features would you expect? How do you see the model?

--
Shai Almog
vPrise Consulting
http://www.vprise.com/

[att1.html]

Shai Almog

I looked at that chart specifically and I found it to be a rather
complicated API to my taste that had many features designed for an MS
project clone (which this is). What I need is a way to visualize some data I
have and allow the user to manipulate it, not nearly as elaborate as a full
blown MS project tool.
GPL isn't necessarily good for me since the purpose is a proprietary
application so I would prefer to have an LGPL solution.
I'd rather not go into too much details since I don't really want to get
into lengthy arguments with authors or fans of these API's about the finer
points of their design.

Anyway I just don't recall most of the stuff since I did the research a
couple of months ago when evaluating tasks.

I'm all for reuse which is why I won't contribute this unless there is a
strong demand for "yet another" gantt chart so I'm not the only idiot who
thinks that "we need another" :-)

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]

reden
Offline
Joined: 2004-01-02
Points: 0

JFreeChart (http://www.jfree.org/jfreechart/) supports Gantt charts. I haven't used that aspect of the library, but I've been very happy with the rest of the library.

Shai Almog

I went over JFreeChart and its mostly used to create static charts and I
didn't see any means of live manipulation of gantt's.
I used JFreeChart in the past as part of a reporting tool and it was very
nice.

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]