Gantt for readonly


#1

Hi,
I need to create a gantt visualization for readonly to show a production plan.
It need to show both progress and a vertical line showing the current time.

Data is to be queried from a SQL DB.

Is there any samples of such solution available


#2

Hi,
sorry for the delayed reply.
We have some tutorials on how to create a gantt app and load the data from SQL databases,
please check this list:
https://docs.dhtmlx.com/gantt/desktop__howtostart_guides.html

In order to make the gantt readonly you need a gantt.config.readonly config

gantt.config.readonly = true;

And for a vertical line showing the current time, please check this article: https://docs.dhtmlx.com/gantt/desktop__markers.html

It’s can be added very simply once you add a markers extension to your page:

   <script src="codebase/dhtmlxgantt.js"></script>   
   <link href="codebase/dhtmlxgantt.css" rel="stylesheet">   
   <script src="codebase/ext/dhtmlxgantt_marker.js"></script>  

and add a line from code:

var dateToString = gantt.date.date_to_str("%g:%i%a, %F %j, %Y");
var markerId = gantt.addMarker({
    start_date: new Date(), //a Date object that sets the marker's date
    css: "today", //a CSS class applied to the marker
    text: "Now", //the marker title
    title:dateToString( new Date()) // the marker's tooltip
});
gantt.init("gantt_here");