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:
How to Add Labels to Scatterplot Points in Excel
How to Change Axis Scales in Excel Plots
How to Add a Vertical Line to Charts in Excel