Table of Contents
To display the date and time on the X-axis of a chart in Excel, follow these steps:
1. Select the chart and right-click on the X-axis.
2. Click on “Format Axis” and a new window will open.
3. Under the “Axis Options” tab, select “Date axis” under the “Axis Type” section.
4. In the “Minimum” and “Maximum” fields, enter the start and end date/time for your data.
5. Click on “Close” to save the changes.
This will display the date and time on the X-axis of your chart in Excel.
Excel: Display Date and Time on X-Axis of Chart
Often you may want to display a date and time on the x-axis of a chart in Excel:
The following step-by-step example shows how to do so in practice.
Step 1: Enter the Data
First, let’s enter the following dataset into Excel:
Step 2: Insert Scatter Plot with Straight Lines
Next, highlight the values in the range A2:B9.
Then click the Insert tab along the top ribbon, then click the icon called Scatter with Straight Lines and Markers within the Charts group.
The following chart will automatically appear:
By default, Excel makes each label on the x-axis horizontal.
However, this causes the labels to overlap in some areas and makes it difficult to read.
Step 3: Rotate Axis Labels
To make the axis labels easier to read, first double click any of the values on the x-axis.
In the Format Axis panel that appears, click the icon called Size & Properties and type -45 in the box titled Custom angle:
The x-axis labels will be rotated at a 45 degree angle to make them easier to read:
Notice that the labels are much easier to read now.
Step 4: Customize the Chart (Optional)
Lastly, feel free to add axis labels, add a chart title, remove the gridlines, and customize the colors to make the chart look exactly how you’d like:
Our chart with a date and time on the x-axis is now complete.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel: