How to Show Actual Years on a Line Chart Axis in Excel
Question details
The user needs to display actual year values on the horizontal axis of a line chart instead of sequential numbers.

- Product
- Excel Online
- Device & OS
- not provided
- Scenario
- Creating a line chart using year data.
- Observed behavior
- Excel Online displays sequential numbers (like 1, 2, 3) on the horizontal axis rather than the actual years from the source data.
Ensure your year data is formatted consistently as text or numbers, and verify that both your year column and measurement column are properly selected before inserting the chart.
Use the Scatter Chart to Line Chart Workaround
Create a scatter chart first to lock in the X-axis values correctly, then change the chart type to a line chart.
Excel Online sometimes interprets a column of numerical years as an additional data series rather than axis labels. By creating a scatter chart first, you force Excel to plot the years strictly on the X-axis.
Highlight the columns containing your years (which will be the X-axis data) and the corresponding measurements (which will be the Y-axis data).
Navigate to the 'Insert' tab on the ribbon, locate the Charts group, and choose 'Scatter' to insert a basic scatter chart.
Check the horizontal (X) axis of the newly created scatter chart to ensure that the actual year values are displayed correctly.
Right-click the chart area, select 'Change Chart Type' from the context menu, and choose 'Line' to convert your scatter chart into a line chart with the correct axis labels.

Manually Edit Horizontal Axis Labels
Directly assign the year column as the horizontal axis category labels using the Select Data Source dialog.
Easily Create Line Charts with Accurate Axis Labels in WPS Office
WPS Spreadsheet provides intuitive chart creation tools that automatically detect year categories, avoiding the frustrating sequential number issue. It is a powerful, seamless alternative for data visualization.
- 1. Open your data file: Launch WPS Spreadsheet and open the document containing your year and measurement data.
- 2. Select your data: Highlight the entire data range, including the column with the years and the column with your values.
- 3. Insert a line chart: Go to the 'Insert' tab on the top menu, click the 'Chart' icon, and select 'Line Chart' from the available options.
- 4. Review axis labels: WPS Spreadsheet will automatically identify the year column and apply it as the horizontal axis labels instantly.

Frequently Asked Questions
Why does Excel treat my years as sequential numbers like 1, 2, 3?
If your year column contains plain numbers and has a column header, Excel may mistakenly interpret it as a second series of numerical data to plot, rather than treating it as category labels for the horizontal axis. It then defaults to numbering the axis 1, 2, 3 for each data point.
How do I format the X-axis as dates instead of text?
Right-click the horizontal axis and select 'Format Axis'. In the format pane under 'Axis Options', look for 'Axis Type' and choose 'Date axis'. Ensure your source data cells are also formatted as Dates, not General or Text.
Does changing the chart type lose my formatting?
Generally, basic formatting and axis values are preserved when switching between similar chart types like Scatter and Line. However, highly specific customizations, like custom data markers or trendlines, might need to be re-applied after the conversion.




