Need to update the Actual BarStyle of Gantt chart and save as MPP file not as PDF

Hello,


I have requirement as need to change the color of the Gantt Actual Bar based on the Delay or Advance progress. Please find the below details

Advance ==> If BaseLineEndDate > ActualEndDate
Delay ==> If BaesLIneEndDate < ActualEndDate

In the above 2 cases, i need to change the color of the Actual Bar differently. Is this possible through Aspose. I am using the very latest version # 8.9.0

Could you please update me as soon as possible as i am mid of POC.

Thanks
Saravanan.

Hi Saravanan,


Thank you for writing to Aspose Support team.

You can customize the Cantt chart bar style using the GanttBarStyle class. Please try the sample code below and share your feedback with us.

Code:

Project project = new Project(TestsUtils.TestdataPath + “New project 2007.mpp”);


project.RootTask.Children.Add(“TASK 1”);


GanttChartView view = project.Views.ToList()[0] as GanttChartView;


GanttBarStyle style = view.BarStyles[0];


style.BottomField = Field.TaskName;


style.MiddleShapeColor = Color.Yellow;


MPPSaveOptions saveOptions = new MPPSaveOptions();


saveOptions.WriteViewData = true;


project.Save(tempFile, saveOptions);