Hi,
It seems that when you have a summary task and GanttBarStyle.RightField set, that the field will be displayed closer to the bar compared to child task, example:
Bar labels (10.6 KB)
in this example you can see summary task also has EndShape and that results in the label being very close to the bar. Can we somehow control spacing between bars and labels?
Project project = new Project();
var ganttChartView = (GanttChartView)project.Views.First(v => v.Name == "&Gantt Chart");
project.StartDate = new DateTime(2024, 2, 1, 0, 0, 0);
project.FinishDate = new DateTime(2024, 5, 20, 0, 0, 0);
SaveOptions options = new PdfSaveOptions()
{
View = new ProjectView(new List<ViewColumn> { new GanttChartColumn ("Name", 200, Field.TaskName) })
};
project.CalculationMode = CalculationMode.None;
Aspose.Tasks.Task task = project.RootTask.Children.Add("Summary1");
task.Id = 1;
task.Start = new DateTime(2024,2,1,0,0,0);
task.Finish = new DateTime(2024,2,21,0,0,0);
Aspose.Tasks.Task subtask = task.Children.Add("Subtask1");
task.Id = 2;
subtask.Start = new DateTime(2024,2,1,0,0,0);
subtask.Finish = new DateTime(2024,2,20,0,0,0);
foreach(GanttBarStyle style in ganttChartView.BarStyles)
{
style.RightField = Field.TaskName;
}
project.Save("CreateTasks_out.pdf", options);
In additions to that, a question. How does one remove all default BarStyles and then creates a bar like the SubTask1 in my sent example. By that i mean that one bar is full size and is filled from Task Start to Finish and another one is half the size of it and is on top of it defining progress of the task?
Thanks in advance.