DataViewsJS and Gantt chart options

Posted by: it on 11 February 2021, 8:00 am EST

    • Post Options:
    • Link

    Posted 11 February 2021, 8:00 am EST

    I have created a Gantt chart following this example https://www.grapecity.com/dataviewsjs/demos/DataViews/GanttView/GanttView/purejs and everything is working fine.

    Now I am trying to make the TimeLineScale customizable but I cannot find any example on how to use IGanttOptions or how to create a Gantt object.

    I have tried this without success:

    const dataView = new DataView(document.getElementById(this.ganttId), data, columns, new GridLayout{...});
    let g = new Gantt(dataView, { timeLineScale : "month" });
    g.timeLineScale = "month";
    

    Can you advice how to solve this?

    Thank you

  • Posted 12 February 2021, 6:59 am EST

    I have found the solution. The problem was that the TimeLineScale of the Gantt is defined in the column definition and not in the DataView properties.

    let columns = [{
    ...
    {
        id: 'gantt',
        ganttColumn: {
    	[b]timeLineScale: timeScale[/b],
    	scale: 300,
    	start: 'start',
    	end: 'end',
    	text: 'description'
        },
        width: '*'
    },
    ...
    }]
    
  • Posted 23 February 2021, 2:53 am EST

    Hi,

    We are glad to know that you were able to find the solution, also thank you for sharing the solution with the community.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels