That for, you have to customize the method so check the example: How to add gantt chart in custom doctype - #8 by avc