BLOGS BY TOPIC▼
BLOGS BY AUTHOR▼
BLOGS BY YEAR▼
Adding basic data labels to a chart can be done without using any programming code. This blog, however, shows you how to fine-tune Excel chart labels using VBA (Visual Basic for Applications) macros.
Posted by Andrew Gould on 08 June 2011
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
The Problem With Labelling the Data Points in an Excel Scatter Chart
Labelling the data points in an Excel chart is a useful way to see precise data about the values of the underlying data alongside the graph itself. In a column chart, for instance, you might show the value of the data point at the top of a column.
A useful addition to a column chart is a set of data labels showing the value of each column.
In certain types of charts, for instance scatter charts or bubble charts, the most useful way to label the data points is apparently impossible to achieve!
|We can plot the Run Time against the Budget...||...but we can't show the Film Titles in the chart!|
The only three options you have when adding a data series to a scatter chart or bubble chart are:
- The value of the X axis (the Run Time value in the above example).
- The value of the Y axis (the Budget value in the above example).
- The name of the data series (the word "Budget" in the above example).
If you choose to show all three options, the resulting chart looks something like this:
It's messy, difficult to read, and it's not even the information we want to see!
There are two ways to get the Film Title in the data labels:
- Identify which data point represents which film and then manually type in the film title. Seriously!
- Use a bit of VBA magic to automatically label each data point with the click of a single button.
Guess which method we're going to describe in part 2 of this series?!
If you find this blog useful, check out our Excel training page, which contains links to Excel blogs, videos, exercises and courses galore!