Grapher has the capability to generate a graph using data associated with dates, times, or both. When the data in the worksheet is stored in date/time format, Grapher will typically recognize the format and generate the axis displaying the dates. By default, Grapher adheres to your Windows locale setting, but you can customize the date/time formats. Furthermore, you can customize the date/time formats on your data and graph axis.
Modify date/time formatting, including non-English labels
Grapher automatically adjusts your plot date/time formats according to your Windows system locale language. Additionally, you can manually set the date/time format to any preferred language. If the custom date/time format used is not recognized by Grapher or if you wish to modify the date/time formatting or interval, follow these steps:
- Select the axis.
- In the Property Manager window, click on Labels.
- Click the
next to the General section to expand it, if necessary.
- In the General section, in the Use date/time format field make sure the box is checked.
- In the General section, in the Major label date/time format field click the Select button.
- The Date/Time Format Builder window will pop up.
- Select the appropriate language in the Language (Country) list and click Insert. For instance, German (Germany) - [$407].
- Select the appropriate Predefined date/time formats option and click Insert.
- If the format you want is not listed, type it manually in the Date/Time format (edit to change) box (e.g., MMMM).
- Click OK and the date/time format is displayed on the axis.
Combining separate date time columns
- In the Object Manager window, right-click on your data layer and select Display Worksheet.
- Note your Date column, Time column, and the first/last rows to be combined.
- Click Data Tools | Data | Transform.
- In the Transform window:
- In the Transform with: dropdown select Column variables (e.g., C = A + B).
- Enter your Transform equation (e.g., D=A+B).
- Fill in the First row and Last row.
- Click OK.
- Format the new column: Select it, click Data Tools | Format | Format Cells, and set the Type to Date/Time.
Keep date/time format from reverting to numbers or text
Grapher can read dates and times in data files, but some formats, like BLN, don't support date/time formatting in worksheets. If your data is saved to a BLN file, follow these steps to preserve your formatting:
- Click File | Open in Grapher and select the file.
- Highlight the column that should be date/time format.
- Click Data Tools | Data | Text to Number to convert text.
- Click Data Tools | Format | Format Cells.
- Set Type to Date/Time and choose the desired format. Click OK.
- Click File | Save As and change the Save as type to DAT, XLS, or XLSX.
Displaying Numeric Values as Dates
The number 1 can symbolize any date or time, and the increment is flexible. For example, the value 2 can refer to the next day if you’re using a serial date format, or an entirely different time interval. In the example below, value 1 represents January 1, 2012, and the value 2 represents January 2, 2012.
The dates in the left column are in custom numeric format.
Creating date/time axes
To create a graph from date/time data, click Graphs | Create | <category> | <plot type>. Select the data file and click Open. The axis will automatically be in date/time format.
Setting the date/time interval on an axis
- In the Property Manager, select the date/time axis.
- Click on the Ticks tab.
- In Major Ticks, check Use date/time spacing.
- Click the Every Year button next to Date/time spacing.
- In the Date/Time Spacing window, set your desired interval (e.g., 3 Months for quarterly).
- Click OK.
Graphing numeric values as dates
You can create a graph that displays date/time labels on your axis even when your data contains numeric values. To convert the numbers to dates:
- Select the axis in the Object Manager.
- In the Property Manager, click the Labels tab.
- Set the Label source to Numeric date/time.
- Click Set next to Date/time settings.
- In the Date/Time Labels dialog:
- Set the Axis value (e.g., 1) and the corresponding Date (e.g., 1/1/2012).
- Set the Axis increment and Corresponding time increment (e.g., Day).
- Click Set date/time format and choose your preferred style (e.g., MMM-dd).
- Click OK.
Comments
Please sign in to leave a comment.