Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 |
|
---|
6 | namespace Microsoft.Research.DynamicDataDisplay.Charts
|
---|
7 | {
|
---|
8 | /// <summary>
|
---|
9 | /// AxisControl for DateTime axes.
|
---|
10 | /// </summary>
|
---|
11 | public class DateTimeAxisControl : AxisControl<DateTime>
|
---|
12 | {
|
---|
13 | /// <summary>
|
---|
14 | /// Initializes a new instance of the <see cref="DateTimeAxisControl"/> class.
|
---|
15 | /// </summary>
|
---|
16 | public DateTimeAxisControl()
|
---|
17 | {
|
---|
18 | LabelProvider = new DateTimeLabelProvider();
|
---|
19 | TicksProvider = new DateTimeTicksProvider();
|
---|
20 | MajorLabelProvider = new MajorDateTimeLabelProvider();
|
---|
21 |
|
---|
22 | ConvertToDouble = dt => dt.Ticks;
|
---|
23 | ConvertFromDouble = d =>
|
---|
24 | {
|
---|
25 | if (d < 0)
|
---|
26 | d = 0;
|
---|
27 | return new DateTime((long)d);
|
---|
28 | };
|
---|
29 |
|
---|
30 | Range = new Range<DateTime>(DateTime.Now, DateTime.Now.AddYears(1));
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.