|
Chart control has the ability to have DateTime values. In addition with this, the Axis Range and Interval could also be set for DateTime values. Refer to the attached sample and the below given code snippets for using this feature. DateTime range could be set using the Axis.DateTimeRange property C# Chart1.Areas[0].PrimaryAxis.IsAutoSetRange = false; Chart1.Areas[0].PrimaryAxis.DateTimeRange = new DateTimeRange(new DateTime(2009, 2, 1, 0, 0, 0), new DateTime(2009, 2, 15, 0, 0, 0)); DateTime interval could be set using the Axis.DateTimeInterval property C# Chart1.Areas[0].PrimaryAxis.DateTimeInterval = new TimeSpan(2, 0, 0, 0); Note: Custom ranges set, will be effective only when the Axis.IsAutoSetRange property is set as false as shown above. |