Is there a way I can make the Gantt chart scale to display in monthly/quarterly by zooming out default?


The complete function below works well (if you have a single gantt on your page). I found that I sometimes got race conditions where the gantt wasn't rendered before I messed with it so this is avoided by doing it in a timeout to allow time for it to render.

    function ScrollGanttToToday(){

            var theGanttGridObject = $("div [id$='_ListViewWebPartJSGrid']")[0].jsgrid;

            theGanttGridObject.ScrollGanttToDate(new Date());
        }, 2000);
  • This worked for me when added to a Script Editor WP on a Site Page with a Task List Gantt View added – Fairfield Mar 15 '16 at 4:27
<script src="URL for jquery-min.js" type="text/javascript">
    <script type="text/javascript">
        for (var i = 0; i < 3; ++i) WebPartWPQ2_JSGridController.ZoomOutGantt()
      }, 2000)

This script helped me to scale and display the gantt chart in quarter.

  • is it possible to make the Gantt Chart show only current week data ?! and also have a search option to look for previous weeks etc? – Bucki Feb 6 '17 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.