Sign in or start a free trial to avail of this feature.
4. Formatting the Horizontal Axis
The horizontal axis needs to be adjusted when you have many datapoints in your dataset. In this lesson, learn how to format the axis to cater for an oil shareprice chart.
To explore more Kubicle data literacy subjects, please refer to our full library.
When to Format the Horizontal Axis (00:04)
Formatting the horizontal axis is only necessary when it contains many data points. This is often the case when plotting stock or commodity prices. In this lesson, we create a line chart of daily oil prices over three years.
When we create the chart, the horizontal axis only includes one entry for each month. It arranges the labels vertically, making them hard to read. We want to format the horizontal axis to reduce the number of entries and make them easier to read.
Formatting the Axis (01:30)
We can improve the horizontal axis by making a series of small changes in the Format Axis window. We open this window by double clicking the horizontal axis.
We can reduce the number of labels by changing the major unit. To do this, we change the number in the Major Unit box under Axis Options. For example, setting this to 2 months means there will be a label every 2 months instead of every month.
To change the format of the numbers, we go to the Number section of the Format Axis window and type the desired format in the Format Code box. In this example, we use the format mmm-yyyy to produce dates in the form of Sep-2014.
We can also adjust the font size of the axis from the Home tab of the ribbon, however it’s easy to make the labels too small to read, so you should be careful about using this option.
Once you’ve got the horizontal axis as you want it, you can improve readability by adding vertical gridlines. To do this, select the chart, then from the Design tab, select Add Chart Element, then Grid Lines and Primary Major Vertical. This makes it easier to match the horizontal axis labels to points on the chart.
In the previous lesson we learnt how to format the vertical axis of a chart.
In this lesson, we'll learn how to format the horizontal axis of a chart. Formatting the horizontal axis is typically only needed when we have many data points. In this example we only have 11 entries in the horizontal axis, so there is no need for any wholesale changes. However, when we have many data points, say when we're plotting stock prices or commodity prices then we'll often need to make adjustments.
In the line chart tab we have a series of commodity prices for oil from the 3rd of January, 2011, all the way to the 6th of January, 2014.
We have 760 data points which we're going to plot on a line chart.
So let's select the data with Ctrl + Shift + Down Arrow, then press Alt + N + N for a line chart and select the 2D option.
We'll now make this chart bigger.
As you can see, the horizontal axis is far from ideal.
It doesn't include all the entries but only the third day of each month because the first entry of the data set was the 3rd of January, 2011. Because there are so many data points these entries are also written vertically which makes the axis very hard to read.
We'd like to reduce the number of entries in the horizontal axis and also change it to a more readable format.
Let's start by double clicking on the horizontal axis.
We'll change the major unit to every two months, which will have the number of entries on the axis.
When we click close, we can see that the access text is now at 45 degrees and is easier to read. Now let's change the format of each entry.
We'll double click on the axis again, and this time we'll go to the number option. We'll change our date format to three M's, a dash and four Y's.
This format converts our date into the three letter abbreviation for the month and the year in question. When we click close we can see that again this improves the readability of the horizontal axis. However, this doesn't solve the problem on its own. Another change we could make is to reduce the size of the font for all these entries. To do this we'll go to the home tab in the ribbon and reduce the size of the font to seven.
We now have horizontal entries but unfortunately they're too small to easily read so we'll undo with Ctrl + Z.
The final option and probably the most effective way of displaying horizontal entries is to go to the format axis dialogue box again and increase the major unit to three months.
This reduces the number of entries in the horizontal axis, so the remaining entries can now be read horizontally.
As you can see, this is now much more readable than the initial horizontal access entries we had when we first created the chart.
Once you're happy with your horizontal axis entries you may want to add some grid lines for these entries. To do this, select the chart, go to grid lines and select primary major vertical.
For most line charts you'll need to make these adjustments to the horizontal axis. Just remember that by changing the major unit and also changing the format of the data entry you can make the access much more readable to your audience.