Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #101019
    admin
    Keymaster

    I have been exploring Gantt Demo and tried using code from here https://www.htmlelements.com/angular/demos/gantt/resource-timeline-mode-diagram/ Which worked initially. But if i remove and have only 2-3 tasks then gantt just does not load. i guess it requires minimum of 4 tasks in order to properly show ?

    #101021
    Hristofor
    Member

    Hi GLMSDev,
    There is no minimal task requirement for the Smart.GanttChart to load data. Perhaps there’s an issue with the dataSource that is loaded. Can you share a code sample with the data that you are loading or a demo from codepen or other ?
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

    #101022
    admin
    Keymaster

    I have used code from here, i have not changed anything  https://www.htmlelements.com/angular/demos/gantt/resource-timeline-mode-diagram
    Just use below JSON as datasource.
     
    <div>
    <div>dataSource: Array<object> = [</div>
    <div>{</div>
    <div>label:’Development’,</div>
    <div>synchronized:true,</div>
    <div>expanded:true,</div>
    <div>disableResources:true,</div>
    <div>type:”project”/* Project */,</div>
    <div>tasks: [</div>
    <div>{</div>
    <div>label:’User Interface Design’,</div>
    <div>dateStart:’2020-02-01′,</div>
    <div>dateEnd:’2020-02-10′,</div>
    <div>progress:0,</div>
    <div>type:”task”/* Task */,</div>
    <div>resources: [{</div>
    <div>id:’megan’,</div>
    <div>label:’Megan’,</div>
    <div>},</div>
    <div>{</div>
    <div>id:’parth’,</div>
    <div>label:’parth’,</div>
    <div>}]</div>
    <div>},</div>
    <div>{</div>
    <div>label:’Controllers & Event’,</div>
    <div>dateStart:’2020-02-10′,</div>
    <div>dateEnd:’2020-02-20′,</div>
    <div>progress:0,</div>
    <div>type:”task”/* Task */,</div>
    <div>resources:’megan'</div>
    <div>}</div>
    <div>]</div>
    <div>}</div>
    <div>];</div>
    </div>

    #101024
    Hristofor
    Member

    Hi GLMSDev,
    there’s a syntax error in the dateStart/dateEnd declaration of the individual tasks:

    
     dateStart:'2020-02-01′,
     dateEnd:'2020-02-10′,
    ...
     dateStart:'2020-02-10′,
     dateEnd:'2020-02-20′,
    

    The closing apostrophe is not the same as the opening. This results in invalid date string declarations. That is why you don’t see any tasks loaded.
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.