Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Change Section height of Gantt Diagram(Nebula, Gantt, GanttSection, Section height)
Change Section height of Gantt Diagram [message #780516] Wed, 18 January 2012 12:29 Go to next message
Bobo xTreme is currently offline Bobo xTremeFriend
Messages: 1
Registered: January 2012
Junior Member
Halo folks,
I'm pleased to be a member of your community.

I work on an implementation of Nebula Gantt.

I've already created the Diagramm and imported Sections, Events and EventGroups and Scopes.
I've attached a picture of my Gantt Diagram.

As you can see in the section is too much free-space, caused by the calculation of the Nebula Gantt API.

Here is the function from
GanttSection.class
for ganttSection height-calculation:

int getEventsHeight(final ISettings settings) {
        if (_ganttEvents.size() == 0) {
            return settings.getMinimumSectionHeight();
        }

        int height = settings.getEventsTopSpacer();

        for (int i = 0; i < _ganttEvents.size(); i++) {
            final IGanttChartItem event = (IGanttChartItem) _ganttEvents.get(i);

            if (event.isAutomaticRowHeight()) {
                height += settings.getEventHeight();
            }
            else {
                height += event.getFixedRowHeight();                
            }

            if (i != _ganttEvents.size() - 1) {
                height += settings.getEventSpacer();
            }
        }

        height += settings.getEventsBottomSpacer();

        if (height < settings.getMinimumSectionHeight()) {
            height = settings.getMinimumSectionHeight();
        }

        return height;
    }



It adds for every event (24 Events at all) more height, but I just need the groupEvents (in this case: 7 GroupEvents)

calculated = 24 * 12px (eventheight) + 26 * 12px (eventspace) = 600px
i need = 7*12 + 9*12 = 192px

I've tried to override the function, but it's private.
What can I do ?

greets.
  • Attachment: Unbenannt.JPG
    (Size: 53.16KB, Downloaded 137 times)

[Updated on: Wed, 18 January 2012 12:35]

Report message to a moderator

Re: Change Section height of Gantt Diagram [message #787392 is a reply to message #780516] Tue, 31 January 2012 14:34 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 294
Registered: July 2009
Senior Member

Hi Bobo,

Please open a bug against technology.nebula for gantt. Please provide a patch if you can.

Best regards,

Wim Jongman
Re: Change Section height of Gantt Diagram [message #827386 is a reply to message #787392] Fri, 23 March 2012 08:59 Go to previous messageGo to next message
Me Name is currently offline Me NameFriend
Messages: 2
Registered: March 2012
Junior Member
There is another way:

Set for every event a fixed row height:

eventOne.setFixedRowHeight(0);

if every event hast a fixed row hight you only have to write your own settings to overwrite the eventspacer:

public class MySettings extends AbstractSettings {
public int getEventSpacer()
{
return 0;

}


}

and at last put your settings in the constructor of the Chart.

GanttChart ganttChart = new GanttChart(shell, SWT.NONE, new MySettings());

And then you've a fixed section hight.

Regards,

Me Name
Re: Change Section height of Gantt Diagram [message #830161 is a reply to message #827386] Tue, 27 March 2012 09:22 Go to previous message
Me Name is currently offline Me NameFriend
Messages: 2
Registered: March 2012
Junior Member
the correct way is to give the ganttsection the ganttgroup and the size will be calculatet right.

                groupOne.addEvent(eventTwo);
		groupOne.addEvent(eventThree);
		
		gs.addGanttEvent(groupOne);


Previous Topic:Grid, GridTableViewer and sorting
Next Topic:Nebula xviewer column resize problem
Goto Forum:
  


Current Time: Fri Nov 28 13:39:59 GMT 2014

Powered by FUDForum. Page generated in 0.01932 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software