Version

Display Data on a Time-Scale Axis

Normally, charts treat date/time values in the data as string values and the X-axis is ordinal and not time-based. If you want to organize your chart data chronologically (even if the data is not in chronological order), you can set up the following chart types to use a time-scale axis:

Note
Note

To create a scatter chart with time values on the x-axis, use the Series collection with one or more NumericTimeSeries. The X-axis labels should have a FormatString like "ITEM_LABEL:MM/dd/yyyy>". Setting the FormatString to "<ITEM_LABEL>" without a format specifier will result in the most reasonable format for the range of the data being used.

To use a time-scale axis:

  1. In the Properties window of the Design view, double-click the property that corresponds to the type of chart that you are configuring. For example, if you are configuring the Area chart, double-click the AreaChart property.

  2. Change the value of the TreatDateTimeAsString property to False. (In the form’s code-behind for the area chart, for example, this would appear as AreaChartAppearance.TreatDateTimeAsString=false).

Data Requirements

The data requirement for a time-based X-axis is that the column names can be parsed as DateTime values. If SwapRowsAndColumns is True, then either a DateTime column, or a column containing strings which can be parsed as DateTime values, must be present (just as if they were row labels).

Note
Note

The above-mentioned data requirements applies to all chart types that support a time-scale axis, except the gantt, step area, and step line charts.

If the Series collection is being used, simply create one or more NumericTimeSeries to use as a data source for the area chart.

For information on displaying axis labels at specific intervals, see Display Labels at Intervals on a Time-Scale Axis.

Shows a 2D Area Chart with Time-Scale axis running along the X Axis.
DateTimeStamp Column1 Column2

1/1/2005

123123

1123

1/2/2005

341212

0

1/3/2005

1231234

0

1/4/2005

234234

0