Angular Gantt Editor is a wrapper for jsgantt-optimized that views/edits Gantt files with formatting.
How to make use of it:
1. First, import the Angular GanttEditor module.
import { NgGanttEditorModule } from 'ng-gantt' @NgModule({ declarations: [ AppComponent ], imports: [ ...., NgGanttEditorModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
2. Then set up your component models as follows:
import { Component, ViewChild } from '@angular/core'; import { GanttEditorComponent, GanttEditorOptions } from 'ng-gantt'; @Component({ selector: 'app-root', template: '<ng-gantt [options]="editorOptions" [data]="data"></ng-gantt>', styleUrls: ['./app.component.css'] }) export class AppComponent { public editorOptions: GanttEditorOptions; public data: any; @ViewChild(GanttEditorComponent, { static: true }) editor: GanttEditorComponent; constructor() { this.editorOptions = new GanttEditorOptions() this.data = [{ 'pID': 1, 'pName': 'Define Chart API', 'pStart': '', 'pEnd': '', 'pClass': 'ggroupblack', 'pLink': '', 'pMile': 0, 'pRes': 'Brian', 'pComp': 0, 'pGroup': 1, 'pParent': 0, 'pOpen': 1, 'pDepend': '', 'pCaption': '', 'pNotes': 'Some Notes text' }]; } }
3. For better design, add the below line to the main style.css file.
@import "~jsgantt-improved/dist/jsgantt.css";
See Demo And Download
Official Website(jsGanttImproved): Click Here
This superior jQuery/javascript plugin is developed by jsGanttImproved. For extra Advanced Usage, please go to the official website.