Enum DateLabel

DateLabel enumeration

Specifies the display format for date and time labels in a timescale.

public enum DateLabel

Values

NameValueDescription
None35No date is displayed.
DayDdd19Examples are Mon, Tue.
DayDddDd105Examples are Mon 30, Tue 1
DayDddMDd112Examples are Mon S 30, Tue O 1
DayDddMmDd108Examples are Mon 9/30, Tue 10/1
DayDddMmDdYy52Examples are Mon 9/30/02, Tue 10/1/02
DayDddMmmDd23Examples are Mon Sep 30, Tue Oct 1
DayDddMmmDdYyy22Examples are Mon Sep 30 ‘02, Tue Oct 1 ‘02
DayDddMmmmDd111Examples are Mon September 30, Tue October 1
DayDddd18Examples are Tuesday, Wednesday.
DayDdi119Examples are Mo, Tu
DayDdiDd106Examples are Mo 30, Tu 1
DayDdiMDd113Examples are Mo S 30, Tu O 1
DayDdiMmDd109Examples are Mo 9/30, Tu 10/1
DayDi20Examples are M, T
DayDiDdSpace107Examples are M 30, T 1
DayDiMDd114Examples are M S 30, T O 1
DayDiMmDd110Examples are M 9/30, T 10/1
DayDiDdNoSpace121Examples are M30, T1
DayMDd115Examples are S 30, O 1
DayMmDd27Examples are 9/30, 10/1
DayMmDdYy26Examples are 9/30/02, 10/1/02
DayMmmDd25Examples are Sep 30, Oct 1
DayMmmDdYyy24Examples are Sep 30 ‘02, Oct 10 ‘02
DayFromEndDayDd41Examples are Day 2, Day 1, Day -1, Day -2 from the project end.
DayFromEndDd54Examples are 2, 1, -1, -2
DayFromEndDdd53Examples are D2, D1, D-1, D-2
DayFromStartDayDd40Examples are Day -2, Day -1, Day 1, Day 2 from the project start.
DayFromStartDd56Examples are -2, -1, 1, 2
DayFromStartDdd55Examples are D-2, D-1, D1, D2
DayOfMonthDd21Examples are 30, 1
DayOfYearDd118Examples are 77, 78
DayOfYearDdYyy116Examples are 77 ‘10, 78 ‘10
DayOfYearDdYyyy117Examples are 77 2010, 78 2010
DayDdMmYyyy256Example is 19/07/2016.
HalfYearH128Examples are 1, 2. Requires the time unit to be TimescaleHalfYears.
HalfYearHh127Examples are H1, H2
HalfYearHhYyy126Examples are H1 ‘10, H2 ‘10
HalfYearHhhHalf123Examples are 1st Half, 2d Half
HalfYearHHyy129Examples are 1H10, 2H10
HalfYearHlfH125Examples are Half 1, Half 2
HalfYearHlfHYyyy124Examples are Half 1, 2010; Half 2, 2010
HalfYearFromEndH135Examples are 2, 1, -1, -2. Half years from the project end date.
HalfYearFromEndHalfH133Examples are Half 2, Half 1, Half -1, Half -2
HalfYearFromEndHh134Examples are H2, H1, H-1, H-2
HalfYearFromStartH132Examples are -2, -1, 1, 2. Half years from the project start date.
HalfYearFromStartHalfH130Examples are Half -2, Half -1, Half 1, Half 2
HalfYearFromStartHh131Examples are H-2, H-1, H1, H2
HourDddMmmDdHhAm28Examples are Wed Mar 18, 8 AM; Wed Mar 18, 9 AM. Requires the time unit to be TimescaleHours.
HourHh32Examples are 8, 9, 10, 11
HourHhMmAm30Examples are 8:00 AM, 9:00 AM
HourHhAm31Examples are 8AM, 9AM
HourMmDdHhAm120Examples are 3/18 8 AM, 3/18 9 AM
HourMmmDdHhAm29Examples are Mar 18, 8 AM; Mar 18, 9 AM
HourFromEndHh77Examples are 3, 2, 1, -1, -2 hours from the project end.
HourFromEndHhh76Examples are H3, H2, H1, H-1, H-2
HourFromEndHourHh39Examples are Hour 3, Hour 2, Hour 1, Hour -1, Hour -2
HourFromStartHh79Examples are -2, -1, 1, 2, 3 hours from the project start.
HourFromStartHhh78Examples are H-2, H-1, H1, H2, H3
HourFromStartHourHh38Examples are Hour -2, Hour -1, Hour 1, Hour 2, Hour 3
MinuteHhMmAm33Examples are 8:00 AM, 8:01 AM, 8:02 AM. Requires the time unit to be TimescaleMinutes.
MinuteMm34Examples are 0, 1, 2, …, 59 minutes
MinuteFromEndMinuteMm37Examples are Minute 181, Minute 180, …, Minute 1, Minute -1 from the project end.
MinuteFromEndMm81Examples are 181, 180, …, 1, -1
MinuteFromEndMmm80Examples are M181, M180, …, M1, M-1
MinuteFromStartMinuteMm36Examples are Minute -2, Minute -1, Minute 1, … Minute 180 from the project start.
MinuteFromStartMm83Examples are -2, -1, 1, …, 180
MinuteFromStartMmm82Examples are M-2, M-1, M1, …, M180
MonthM11Examples are M, A, M, J, J. Requires the time unit to be TimescaleMonths.
MonthMm57Examples are 11, 12, 1, 2
MonthMmYy86Examples are 3/10, 4/10, 5/10
MonthMmYyy85Examples are 3 ‘10, 4 ‘10, 5 ‘10
MonthMmm10Examples are Mar, Apr, May
MonthMmmYyy8Examples are Mar ‘10, Apr ‘10, May ‘10
MonthMmmm9Examples are March, April, May
MonthMmmmYyyy7Examples are March 2010, April 2010, May 2010
MonthFromEndMm59Examples are 2, 1, -1, -2 months from the project end.
MonthFromEndMmm58Examples are M2, M1, M-1, M-2
MonthFromEndMonthMm45Examples are Month 2, Month 1, Month -1, Month -2
MonthFromStartMm61Examples are -2, -2, 1, 2 months from the project start.
MonthFromStartMmm60Examples are M-2, M-1, M1, M2
MonthFromStartMonthMm44Examples are Month -2, Month -1, Month 1, Month 2
QuarterQ62Examples are 3, 4, 1. Requires the time unit to be TimescaleQuarters.
QuarterQq6Examples are Q3, Q4, Q1
QuarterQqYyy4Examples are Q3 ‘10, Q4 ‘10, Q1 ‘11
QuarterQqqQuarter2Examples are 3rd Quarter, 1st Quarter
QuarterQQyy51Examples are 3Q10, 4Q10, 1Q11
QuarterQtrQ5Examples are Qtr3, Qtr4, Qtr1
QuarterQtrQYyyy3Examples are Qtr3, 2010; Qtr4, 2010; Qtr1, 2011
QuarterFromEndQ64Examples are 5, 4, 3, 2, 1, -1 quarters from the project end.
QuarterFromEndQq63Examples are Q5, Q4, Q3, Q2, Q1, Q-1
QuarterFromEndQuarterQ47Examples are Quarter 5, Quarter 4, Quarter 3, Quarter 2, Quarter 1, Quarter -1
QuarterFromStartQ66Examples are -5, -4, -3, -2, -1, 1 quarters from the project start.
QuarterFromStartQq65Examples are Q-5, Q-4, Q-3, Q-2, Q-1, Q1
QuarterFromStartQuarterQ46Examples are Quarter -5, Quarter -4, Quarter -3, Quarter -2, Quarter -1, Quarter 1
ThirdsOfMonthsDd136Examples are 1, 11, 21, 1. Requires the time unit to be TimescaleThirdsOfMonths.
ThirdsOfMonthsDdd137Examples are B, M, E, B
ThirdsOfMonthsDddd138Examples are Beginning, Middle, End, Beginning
ThirdsOfMonthsMmDd139Example is 3/1.
ThirdsOfMonthsMmDdYy145Example is 3/1/10.
ThirdsOfMonthsMmDdd140Examples are 3/B, 3/M, 3/E, 4/B
ThirdsOfMonthsMmDddYy146Example is 3/B/10.
ThirdsOfMonthsMmmDd142Examples are Mar 1, Mar 11, Mar 21, Apr 1
ThirdsOfMonthsMmmDdYy147Examples are Mar 1, ‘10; Mar 11, ‘10; Mar 21, ‘10; Apr 1, 10
ThirdsOfMonthsMmmDdd143Examples are Mar B, Mar M, Mar E, Apr B
ThirdsOfMonthsMmmDddYy148Examples are Mar B, ‘10; Mar M, ‘10; Mar E, ‘10; Apr B ‘10
ThirdsOfMonthsMmmmDd144Examples are March 1, March 11, March 21, April 1
ThirdsOfMonthsMmmmDdYyyy149Examples are March 1, 2010; March 11, 2010; March 21, 2010; April 1, 2010
ThirdsOfMonthsMmmmDddd141Examples are March Beginning, March Middle, March End, April Beginning
ThirdsOfMonthsMmmmDdddYyyy150Examples are March Beginning, 2010; March Middle, 2010; March End, 2010; April Beginning, 2010
WeekDddDd88Examples are Sun 21, Sun 28, Sun 4. Requires the time unit to be TimescaleWeeks.
WeekDddMDd97Examples are Sun M 21, Sun M 28, Sun A 4
WeekDddMmDd90Examples are Sun 3/21, Sun 3/28, Sun 4/4
WeekDddMmDdYy100Examples are Sun 3/21/10, Sun 3/28/10, Sun 4/4/10
WeekDddMmmDd93Examples are Sun Mar 21, Sun Mar 28, Sun Apr 4
WeekDddMmmDdYyy101Examples are Sun Mar 21, ‘10; Sun Mar 28, ‘10; Sun Apr 4, ‘10
WeekDddMmmmDd96Examples are Sun Mar 21, Sun March 28, Sun Apr 4
WeekDddMmmmDdYyy102Examples are Sun March 21, ‘10; Sun March 28, ‘10; Sun April 4, ‘10
WeekDddWw103Examples are Sun 12, Sun 13, Sun 14
WeekDdiMDd98Examples are Su M 21, Su M 28, Su A 4
WeekDdiMmDd91Examples are Su 3/21. Su 3/28, Su 4/4
WeekDdiMmmDd94Examples are Su Mar 21, Su Mar 28, Su Apr 4
WeekDiMDd99Examples are S M 21, S M 28, S A 4
WeekDiMmDd92Examples are S 3/21, S 3/28, S 4/4
WeekDiMmmDd95Examples are S Mar 21, S Mar 28, S Apr 4
WeekMDd89Examples are M21, M28, A 4
WeekMmDd17Examples are 3/21, 3/28, 4/4
WeekMmDdYy16Example is ‘3/21/10’.
WeekMmmDd15Examples are Mar 21, Mar 28, Apr 4
WeekMmmDdYyy13Examples are Mar 21, ‘10; Mar 28, ‘10; Apr 4, ‘10
WeekMmmmDd14Examples are March 21, March 28, April 4
WeekMmmmDdYyyy12Examples are March 21, 2010; March 28, 2010; April 4, 2010
WeekDayOfMonthDd87Examples are 21, 28, 4
WeekFromEndWeekWw43Examples are Week 2, Week 1, Week -1 from the project end.
WeekFromEndWw68Examples are 2, 1, -1
WeekFromEndWww67Examples are W2, W1, W-1
WeekFromStartWeekWw42Examples are Week -1, Week 1, Week 2 from the project start.
WeekFromStartWw70Examples are -1, 1, 2
WeekFromStartWww69Examples are W-1, W1, W2
WeekNumberDdWw104Examples are 1 12, 1 13, 1 14 (day 1 of week 12, day 1 of week 13, and so forth)
WeekNumberWw50Examples are 12, 13, 14
YearYy75Examples are 10, 11, 12. Requires the time unit to be TimescaleYears.
YearYyy1Examples are ‘10, ‘11, ‘12
YearYyyy0Examples are 2010, 2011, 2012
YearFromEndYearYy49Examples are Year 2, Year 1, Year -1 from the project end.
YearFromEndYy72Examples are 2, 1, -1
YearFromEndYyy71Examples are Y2, Y1, Y-1
YearFromStartYearYy48Examples are Year -1, Year 1, Year 2 from the project start.
YearFromStartYy74Examples are -1, 1, 2
YearFromStartYyy73Examples are Y-1, Y1, Y2

Examples

Shows how to customize timescale tier labels.

var project = new Project(DataDir + "CreateProject1.mpp");

// Add task links
project.TaskLinks.Add(project.RootTask.Children.Add("Task 1"), project.RootTask.Children.Add("Task 2"));

var view = (GanttChartView)project.DefaultView;

// tune timescale tiers

// tune the top tier
// set the top timescale tier of the Gantt Chart view.
view.MiddleTimescaleTier = new TimescaleTier();
// set timescale unit <see cref="T:Aspose.Tasks.Visualization.TimescaleUnit" /> for the timescale tier.
view.MiddleTimescaleTier.Unit = TimescaleUnit.Weeks;
// set the time unit interval in which to show labels for the tier.
view.MiddleTimescaleTier.Count = 1;
// set date label <see cref="T:Aspose.Tasks.Visualization.DateLabel" /> for the timescale tier.
view.MiddleTimescaleTier.Label = DateLabel.WeekDddDd;
// set how to align labels within each time period of the tier (<see cref="T:System.Drawing.StringAlignment" />).
view.MiddleTimescaleTier.Alignment = HorizontalStringAlignment.Center;
// set a value indicating whether whether to show tick marks that separate time periods in the tier.
view.MiddleTimescaleTier.ShowTicks = true;
// set a value indicating whether to base the tier labels on the fiscal year.
view.MiddleTimescaleTier.UsesFiscalYear = true;

// added for better visualization
view.TopTimescaleTier = new TimescaleTier(TimescaleUnit.Months, 1);

// customize middle tier dates
view.TopTimescaleTier.DateTimeConverter = date =>
    new[] { "Янв.", "Фев.", "Мар.", "Апр.", "Май", "Июнь", "Июль", "Авг.", "Сен.", "Окт.", "Ноя.", "Дек." }[date.Month - 1];

project.Set(Prj.TimescaleStart, new DateTime(2012, 7, 30));
project.Set(Prj.TimescaleFinish, new DateTime(2012, 10, 6));

// Use 'Timescale.DefinedInView' option to render timescales using timescale settings defined in view (view.TopTimescaleTier, view.MiddleTimescaleTier, view.BottomTimescaleTier). 
var pdfSaveOptions = new PdfSaveOptions
{
    Timescale = Timescale.DefinedInView
};

project.Save(OutDir + "CustomizeTimescaleTierLabels_out.pdf", pdfSaveOptions);

See Also