cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically change height of my Gantt Chart

Sunitkroy
Participant
0 Kudos

Hi all

How to dynamically change height of my Gantt Chart? Is there any solution for that? Actually I have a Gantt chart having height 400. Now when I have too many number of records the display bars are very small and when I have one or two records the display bars are utilizing total 400 height having 200 each that looks

very fat. Any help will be highly appreciated.

regards

Kam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I hope help you.

IWDGantt ganttVarName = (IWDGantt)view.getElement("GanttID"); 
         ganttVarName .setHeight("200px");

If you would change this height when you are creating the content you cant get the Heigth of the gantt and augmented it.

Sorry for my english

Regards,

Gabriel

Answers (1)

Answers (1)

former_member187658
Participant
0 Kudos

Hi Sunit

you can change the height of the UI element using


IWDBusinessGraphics bg = null; // declare in global area
 bg = (IWDBusinessGraphics) view.getElement("BusinessGraphics1"); // this code line to be written in wdModifyView();
bg.setHeight();// can be used anywhere in the code in any method

But as your data may vary for every reading, depending upon the size of your node to which the chart is linked, try setting approximate values for a given range using the above code by checking a condition. i am not sure for each n every different set of values you can change it dynamically.

Thanks & regards,

Anupreet

Sunitkroy
Participant
0 Kudos

Hi Anupreet

thanks for your answer but what do you mean by global area?

jcvidaller
Participant
0 Kudos

Hi Kam,

You can declare global variables for your view between...

//@@begin others

IWDBusinessGraphics bg = null;

//@@end

... at the end of the wiew code. Be carreful, because any code put out of these marks will be deleted.

Another way to use goblal variables is using the view context... You can create an IWDGantt attribute and use it everywhere:

// this code line to be written in wdModifyView()

if(firstTime){

wdContext.currentContextElement.setMyGanttReference((IWDGantt)view.getElement("GanttID"));

}

// and then, anywhere in the code in any method

wdContext.currentContextElement.getMyGanttReference().setHeight(...);

I hope it helps!

jc!