Design Guide 5.1.2 > Scales and Grids

Time Scales

Time Scales are used in Time Plot graphs. They work much like Value Scales, except they use dates or times instead of numbers. Using the Bottom Scale Properties dialog for a Time Plot graph, you can customize the way the scale behaves, as well as the way the times and dates are displayed.

This section discusses the following topics:

The Date Input Format

If this is your first time using Time Plot graphs, you may have encountered a problem where the times and dates at the bottom of the graph aren't displaying correctly. This happens because the times and dates in the data you sent to PopChart+OptiMap were not in the correct format.

Does this mean you have to go and reformat your times and dates? Thankfully, no. Each graph in PopChart+OptiMap uses its own date input format string to regulate how it interprets date and time input.

For example, the default date input format string is %m/%d/%Y. This means that when you enter data into the Data Editor, or when you send data dynamically to your PopChart+OptiMap server, you need to enter the month, followed by a slash, followed by the day, followed by a slash, followed by the four digit year (e.g. 12/31/2001).

However, you can change this string so that your graph can accept data with dates and times in just about any format. PopChart+OptiMap uses macros to indicate different values, such as month, day, or minute. You can also enter static text if your time values contain slashes or colons.

Suppose all of the time values you are graphing occur on the same day, and you just want to enter the hour and minutes (e.g. 9:30, 10:00, 14:15, etc.). To do this, you would choose %H:%M as your date input format.

A complete list of available macros is available in Table 8.4

 
Table 8.4 Date Formatting Macros
%Y
Four-digit year (e.g., 2001)
%y
* Two-digit year (e.g., 01)
%m
Month of year (1-12)
%b
** Name of month
%d
Day of month (1-31)
%H
Hour (0-23)
%M
Minute (0-59)

, below.

Note: The %b macro requires some additional explanation. This macro represents month names (e.g. January, February, etc.). In some cases, you may want to define what names PopChart+OptiMap should expect to find in dates. For example, if all of your month names are abbreviated, you will need to tell PopChart+OptiMap to search for the abbreviations instead of the full name. In these cases, you can define month names with the Graph Properties > Month/Day Names tab.

To edit the data input format

  1. Select a Time Plot graph.
  2. Select Properties > Graph Properties.
  3. Enter a string in the Date Input Format box.
  4. A complete list of date and time macros is available in the Date Formats pull-down menu below.

  5. Select OK or Apply to save your settings.

Explanation of Time Scale Behavior

Like a value scale, the time scale automatically sizes itself according the data points it needs to plot. As part of this sizing algorithm, it attempts to determine an appropriate base unit of measurement for the scale. For example, a graph with data values that range over the course of half a year would probably use months as the base unit of measurement. On the other hand, a graph with values that range over the course of only an hour might use 10 minutes as the base unit of measurement. The base unit of measurement becomes the increment between each major tick mark and scale label.

Time scales are unique in that they also can have minor scale labels. Minor scale labels are applied when there are only one or two major scale labels. For example, if your data values ranged over a single month, the month would still be the major scale label. But because there would only be one or two major scale labels, the graph would also have minor scale labels indicating days of the month.

The algorithm that PopChart+OptiMap employs to determine the increments between major and minor scale labels is too complicated to mention here. However, you do have a lot of control over the format of your scale labels, as you will see in the next few sections.

Eliminating White Space at the Beginning and End of Your Graph

PopChart+OptiMap automatically sets the scale so that there is a certain amount of white space before the first data value and after the last data value in the graph. You can disable this behavior by checking the Eliminate White Space At Beginning and End of Scale box in the Scale tab of a time scale's Bottom Scale Properties dialog.

Manually Setting the Scale Range

Typically, PopChart+OptiMap automatically sets the range of your scale. However, you can change the range manually by selecting Manually in the Set Scale Values box. You can then define a start date and end date for the scale in the corresponding boxes.

You can also have PopChart+OptiMap check to make sure all of the data values in the graph fall within your manually defined scales. If a data value falls outside of the range, PopChart+OptiMap will resize the scale appropriately. To enable this behavior, check the Change Start and End Dates box.

Changing the Tick Mark Increments

You have the option of either changing the tick mark increments automatically or manually.

Automatically
Manually

As mentioned in "", time scales employ a base unit of measurement to determine what the major and minor scale labels will be. Depending on what the base unit of measurement is, the scale labels will be formatted differently.

You can change the format for both minor and major ticks. The options are as follows:

For an example, if the base unit of measurement is simply a matter of minutes, the scale labels would use the Minutes format, and would probably look something like this: 9:30AM, 9:35AM, 9:40AM, etc. However, if the base unit of measurement is a matter of days, the major scale labels would use the Days format, and would probably look something like this: Sunday, Monday, Tuesday, etc.

Rotating Time Scale Labels

You can rotate time scale labels by increments of 15 degrees by going to the Label tab of a time scale's Bottom Scale Properties dialog, checking the box next to Rotate, and then selecting a number of degrees from the pull-down menu to the right.

Changing Fonts and Colors

Minor scale labels and major scale labels use different fonts. For that reason, the Time Scale Properties dialog has both a Font and Font (Minor labels) tab. Both of these dialogs function exactly like the Fonts dialog pane mentioned in "Changing Font and Color", except they change the fonts and colors of the time scale label.