How to swap the X-axis and Y-axis positions in an Excel chart
Explain several ways to swap the X-axis and Y-axis in Excel charts: change column charts to bar charts, switch rows and columns, and swap value ranges in scatter charts, and explain which coordinate axis settings need to be checked after swapping.
Key points of this article
- If you want to turn a column chart into a horizontal bar chart, the direct way is to change the chart type, and the categories will automatically move to the vertical axis.
- Switching rows/columns changes the corresponding relationship between data series and classification, which does not mean simply swapping the horizontal and vertical coordinates.
- The X and Y of the scatter plot are determined by the data area. To exchange, edit the X value and Y value reference range of the series.
- After the exchange, the axis titles, scale ranges and data labels must be rechecked, and manually set scales will not automatically follow.
- Setting the coordinate axis scale (minimum value, maximum value, interval) is another matter, and should not be confused with exchanging directions.
Many people find after making charts in Excel that the horizontal and vertical axes are reversed: the category names are squeezed underneath, but the values are pulled to one side, making it awkward to read. If you want to change the column chart to a horizontal bar chart, or have the data displayed in another direction, you need to swap the positions of the X-axis and Y-axis. This article is written for readers who are doing work reports, paper illustrations or data analysis reports and need to adjust the direction of charts.
The crux of the matter is: "swap coordinate axes" actually has several different meanings. Some people want to arrange the categories horizontally, some want to reverse the positions of the two sets of values, and some just want to change the scale range. Only by figuring out which one do you want can you choose the right method. After reading this article, you can decide which method to use for your own chart, follow the steps to complete the swap, and check the areas where errors are likely to occur after the swap.
How to swap the X-axis and Y-axis in a chart? One sentence conclusion
First determine whether you want "direction swap" or "data swap". If you just want to change the column chart into a horizontal bar chart, just change the chart type; if it is a scatter chart, you need to exchange the X and Y values of the data itself.
| your situation | Recommended practices | reason |
|---|---|---|
| Column chart, want category names to be arranged horizontally | Change chart type to bar chart | The categories of bar charts are on the vertical axis and the values are on the horizontal axis. This is the standard definition of Excel. |
| The data is arranged by rows or columns, and you want to reverse the series and categories. | Use "Toggle Row/Column" | What changes is the corresponding relationship between data series and classification, and the chart type can remain unchanged. |
| For a scatter plot, you want the original X data to be vertical and the Y data to be horizontal. | Edit the data series and swap the reference ranges for X and Y values | The horizontal and vertical positions of the scatter plot are completely determined by these two sets of values. |
| Just want to change the numerical range of the coordinate axis | Set axis scale (minimum value, maximum value, interval) | This is an adjustment scale and does not change the direction of the axis |
Before you start: Confirm these points first
Confirm chart type. In Excel, the horizontal axis of column charts and line charts usually represents categories and the vertical axis represents numerical values; the reverse is true for bar charts. Looking directly at the chart, if the horizontal axis is the name, it is a column or line type; if the vertical axis is the name, it is already a bar type. If the type is wrong, subsequent operations will take detours.
Confirm data area. The data for the chart comes from a cell in the worksheet. Before exchanging, open the data source settings first and see clearly which cells each series refers to, so as to avoid changing the chart but getting the data correct.
Confirm if the data source is in the PDF. If the data comes from a PDF report, you need to put the table into Excel first. The PDF editor of the OmniDoc desktop client supports exporting to Excel; scanned PDFs can be recognized using OCR before exporting. After exporting, you still need to check whether the numbers are consistent with the original text. Typos or serializations may occur during the recognition process.
Confirm whether there is a manually set scale. If the small or large values of the coordinate axis have been manually fixed before, these values will not automatically switch to the other axis after the direction is swapped, and need to be rechecked.
Confirm chart purpose. For figures used for reports, you usually want the category names to read smoothly, and bar charts are more suitable. For figures used in papers, you must comply with the chart format requirements of the journal or school. It is recommended to read the template before making changes.
Steps to change column chart to bar chart in Excel
Here we take the common "column chart to horizontal bar chart" as an example to write a common operation. The button locations are slightly different in each version of Excel, but the idea is the same.
- Select the chart. Click on the blank space of the chart to ensure that the chart is selected. Chart-related design options will appear.
- Open chart type settings. Find "Change Chart Type" among the options related to chart design, which is usually located in the design area of the chart tool.
- Select Bar Chart. Select a style of bar chart in the type list, such as clustered bar chart, and confirm that the categories have been moved to the vertical axis in the preview.
- Check the sorting order. Bar charts will put the first category below by default, which is contrary to the convention of column charts. If you want the order to be consistent with the original, you need to check "Reverse categories" in the settings of the category axis.
- Adjust the value axis position. The value axis of the bar chart appears below. If you find that it is squeezed to the top of the graph, you can change the vertical coordinate intersection position to "Large Category" in the coordinate axis settings to return the value axis to the appropriate position.
- Confirm that the data has not changed. Compare the worksheet to check whether the category names and values are consistent with those before the change. Don’t just look at the shape of the picture.
How to swap rows and columns of data and scatter plots
If your chart is composed of multiple sets of data series and you want to swap series and categories, you can use "Switch Rows/Columns". It is often used when the data is arranged in the wrong direction. For example, each month is a row and each product is a column, but the chart wants to be classified by product. After switching, the corresponding relationship between series and categories will be reversed as a whole. You need to check whether the legend becomes difficult to understand.
The situation is different with scatter plots. It has no concept of "classification", and the two coordinate axes are determined by the X value and the Y value respectively. To exchange the horizontal and vertical positions, you need to open the data source settings, select a series, change the reference area of "X-axis value" to the original Y data area, and change the reference area of "Y-axis value" to the original X data area. After the modification is completed, the chart will be redrawn with the new values. This operation needs to be done once for each series, and it is necessary to confirm that the new X value and Y value correspond one to one, otherwise the position of the points will be confused.
Check each item after completion
Just because the chart looks right after swapping directions, doesn't mean the data and settings are correct. The table below can serve as a checklist.
| Check items | How to see | What to do if there is a problem |
|---|---|---|
| Do classification and numerical values correspond? | Select two or three categories and compare the numbers against the worksheet | Go back to the data source settings and confirm whether the referenced cell range is correct. |
| Whether the axis title has been updated | Check whether the horizontal and vertical axis titles still point to their original meaning | Directly modify the title text to avoid "quantity" being marked on the category axis |
| Whether the scale range is reasonable | Check the small and large values on the numeric axis to see if they are truncated or leave too much blank | Restore the automatic scale or reset it based on the data |
| Whether the classification order conforms to custom | In the bar chart, is the first item at the top? | Use reverse order categories in the category axis settings |
| Data labels and legends | Check whether the label numbers remain in their original positions, and whether the legend matches the series | Readd or adjust data labels and check the legend name |
| Chart export results | After copying to Word or PowerPoint, check whether the size and text are clear | Adjust the chart size and check if the font is distorted |
If the chart is to be used for formal reporting, it is recommended to re-compare the values with the original data. The display effect of the chart itself can be adjusted through settings, and whether the data is correct requires manual verification.
📊 Core Comparison
| Method | Applicable charts | Main effects | Notes |
|---|---|---|---|
| Change the chart type to bar chart | Bar chart | Categories are moved to the vertical axis and values to the horizontal axis | If the classification order is reversed, you need to set the reverse order of categories |
| Switch rows/columns | Multiple series of bar and line charts | Switching between series and classification | The legend changes, so the meaning needs to be reaffirmed |
| Swap X and Y references | Scatter plot | The horizontal and vertical positions of the two sets of values are swapped | Each series needs to be modified, which can easily lead to misquotations |
| Set the coordinate axis scale | All charts | Adjust the value range and interval | Do not change the direction, only the display range of the values |
❓ Frequently Asked Questions (FAQ)
1. Will data be lost after swapping the X-axis and Y-axis?
No. The swap changes the way the chart is displayed; the original data in the worksheet is not deleted. However, if you edit the reference area in the data source incorrectly, the chart will display the wrong data, so after making changes, you need to check against the original table.
2. Why are bar chart categories arranged from bottom to top?
This is the default arrangement of Excel bar charts, with the first category located below. If you want to read from top to bottom, you can select the reverse category in the category axis settings, so the order matches the worksheet's arrangement.
3. What is the difference between setting a coordinate axis scale and swapping the X-axis and Y-axis?
The scale setting adjusts the small value, large value, and spacing of the numerical values; the axis direction does not change. The interchangeable direction changes which axial amplifier category and value are changed; the two solve different problems and should not be mixed.
4. Can a line chart be directly converted to a horizontal layout?
Line charts usually keep the horizontal axis for categories and the vertical axis for values. If horizontal display is needed, consider using bar charts or other chart types, since line charts themselves are not suitable for horizontal layout.
📝 Summary
When swapping the X-axis and Y-axis in Excel charts, the key is to first distinguish whether you want direction reversal, data reversal, or scale adjustment. Bar charts can be changed to bar charts, row and column switches, and scatter plots can be swapped and referenced, each applicable to different situations. After completion, check each category, title, scale, and label item by item to ensure the chart is both visually appealing and accurate.


