Timescale Labels

Hi,

When i set TimescaleStart as 3rd day of february and in addition i choose TimescaleUnit.Months, the label of february will not appear unless i change this: project.TimescaleStart = new DateTime(2024, 2, 3, 0, 0, 0); to this project.TimescaleStart = new DateTime(2024, 2, 1, 0, 0, 0);

Example:

DateTime with day set as 3 (17.6 KB)

DateTime with day set as 1 (18.8 KB)

Code i used:

Project project = new Project();
var ganttChartView = (GanttChartView)project.Views.First(v => v.Name == "&Gantt Chart");

SaveOptions options = new PdfSaveOptions()
{
    Timescale = Timescale.DefinedInView
};


Aspose.Tasks.Task task = project.RootTask.Children.Add("Summary1");
task.Start = new DateTime(2024,2,1,0,0,0);
task.Finish = new DateTime(2024,5,1,0,0,0);
Aspose.Tasks.Task subtask = task.Children.Add("Subtask1");
subtask.Start = new DateTime(2024, 2, 10, 0, 0, 0);
subtask.Finish = new DateTime(2024, 5, 1, 0, 0, 0);

project.CalculationMode = CalculationMode.None;
project.TimescaleStart = new DateTime(2024, 2, 3, 0, 0, 0);
project.TimescaleFinish = new DateTime(2024, 2, 28, 0, 0, 0);

ganttChartView.TopTimescaleTier = null;
ganttChartView.MiddleTimescaleTier = new TimescaleTier();
ganttChartView.BottomTimescaleTier = new TimescaleTier();

ganttChartView.MiddleTimescaleTier.Count = 1;
ganttChartView.MiddleTimescaleTier.Unit = TimescaleUnit.Months;
ganttChartView.MiddleTimescaleTier.Label = DateLabel.MonthMmmmYyyy;

ganttChartView.BottomTimescaleTier.Count = 1;
ganttChartView.BottomTimescaleTier.Unit = TimescaleUnit.Days;
ganttChartView.BottomTimescaleTier.Label = DateLabel.WeekDayOfMonthDd;

project.Save("CreateTasks_out.pdf", SaveFileFormat.Pdf);

@Herrington ,
when Timescale.Alignment is HorizontalStringAlignment.Near (Left), the label for month is rendered above 1st day. MS Project shows the similar logic: month’s label is aligned with 1st day.

What is the expected result when timescale’s start is set to Feb 02??

  1. Aspose.Tasks should render “ruary” over 02 Feb (as MS Project does)
    or
  2. Aspose.Tasks should render "February"over 02 Feb?

@vasiliy.sinitsyn
Its naturally strong argument to make it as MS Project, but at the same time i think it makes more sense if label is shown at all times. For example if i set it to HorizontalStringAlignment.Center, i would expect it to be centered at all times on the avilable space that it has.

Right now it seems that its always rendered in the center regardless of what Alignment is set to, im using Aspose.Tasks 24.6.0.

@Herrington,
we have opened 2 new tickets in our internal issue tracking system (to fix missing label when TimescaleStart is not 1st day of month issue and to fix Timescale.Alignment is not working issue)

The fixes will be delivered according to the terms mentioned in Free Support Policies.

Issue ID(s): TASKSNET-11225,TASKSNET-11226

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.