Skip to main content

Gantt

Render Gantt

Method to render the gantt chart

render
javascriptgantt.render();

Here element is the div where you want to append gantt, element is optional if you are not calling render function first time in your code;

Destroy Gantt

Method to destroy the gantt chart

destroy
javascriptgantt.destroy();

Get the current zoom level scale config

Method to get the current level zoom scale

getScale
javascriptgantt.getScale();

Initialize zoom level

Method to initialize the zoom level, call this method

zoomInit
javascriptgantt.zoomInit();

Request FullScreen

Method to view gantt in fullscreen

requestFullScreen
javascriptgantt.requestFullScreen();

Exit FullScreen

Method to exit fullscreen

exitFullScreen
javascriptgantt.exitFullScreen();

Expand All

Method to expanding all tasks

expandAll
javascriptgantt.expandAll();

Collapse All

Method to Collapsing all tasks

collapseAll
javascriptgantt.collapseAll();

Add new data to existing data

Using this you can add new data to the existing data in gantt here data is array which contain new data

parse
javascriptgantt.parse(data);

Clear All

It clears the old data use it only when you change the data from your side.

clearAll
javascriptgantt.clearAll();

Get date cell position

Get the position of the date cell from timeline start

posFromDate
javascriptgantt.posFromDate();

Auto Scheduling

Method to automatically schedule your tasks based on the relations between them.

autoScheduling
javascriptgantt.autoScheduling();

Sort Data

To initiate sorting within the grid based on a specific action or event, such as a button click or page load, simply invoke the sort method.
here text is the column field name on that basis data will be sorted, and second parameter true is boolean which is sorting order asc or desc.

sort
javascriptgantt.sort("text", true);

Attach an event

Method to attach an event to Gantt chart.

it take two param first is event name and second is a callback function which execute when the event is triggered.

attachEvent
javascriptgantt.attachEvent("onTaskDblClick", (event) => {
console.log("onTaskDblClick: ", event);
});

Initialize zoom

Method to initialize level. After setting zoomLevel and zoomConfig run javascriptgantt.zoomInit() for applying your current zoom level

zoomInit
javascriptgantt.zoomInit();

Set Language

Method to set or change the language

setLocalLang
javascriptgantt.setLocalLang("hi");
LanguageLanguage Code
Arabicar
Belarusianbe
Englishen
Catalanca
Chinesecn
Croatianhr
Czechcs
Danishda
Dutchnl
Finnishfi
Frenchfr
Germande
Greekel
Hebrewhe
Hindi (India)hi
Hungarianhu
Indonesianid
Italianit
Japanesejp
Koreankr
Norwegianno
Persianfa
Polishpl
Portuguesept
Romanianro
Russianru
Slovaksk
Sloveniansi
Spanishes
Swedishsv
Turkishtr
Ukrainianua