|
Peltier Tech
Buy me a coffee If this topic or the whole site has been helpful, please support further development by treating me to a cup of coffee. |
Add Labels to Points that are Off Scale.
Data labels are a handy way to annotate a chart. But if a point is off scale, the data label also disappears. This page shows how to display alternate labels that indicate out of range points. In this chart, all points appear on scale, and all data labels are visible.
In this chart, the Y axis maximum has been manually set at 12, but two points exceed this limit. We know this only because the lines extend off scale.
We will add a new series to hold the necessary data labels. The data is shown in the grid below. Cell C1 holds the Y axis maximum. Columns A and B contain the data that is already in the chart. We've included some formulas in column C. The formula in C3 is: =IF(B3>$C$1,$C$1,NA()) Select the cell, click on the small square at the bottom right corner of the cell, and drag it down to fill the range down to C10. This formula shows either the Y axis maximum, if the data value exceeds the maximum, or the #N/A error if it doesn't. In a line or XY series, #N/A values are not plotted, and no data labels appear for these points.
First we need to add the new data to the chart. Select the chart, and choose Source Data from the Chart menu. Click on the Series tab, then click Add. Click in the Name input box, and select cell C2 ("Outliers"). The box is populated with the cell reference =Sheet1!$C$2. Clear the ={1} from the Values box, then select the data in C3:C10. The box is populated with the range reference =Sheet1!$C$3:$C$10. Click OK, and the new series appears in the chart.
When the Y axis maximum is set back to 12, the two original points disappear, but the added labels show where the points crossed above the top of the chart.
Time for clean-up. Double click the added series, and on the Patterns tab, choose None for Markers and for Lines, to hide the series. Select the legend, then select the legend entry (the "Outliers" label), and press Delete to remove this extraneous legend entry.
Instead of hiding the markers for the Outliers series, you can apply a custom marker to help indicate the out-of-range points. This is especially useful if the chart series has no lines connecting the points. For this chart I drew a red arrow in the worksheet, copied it, selected the Outliers series, and pasted, to assign the arrow as the series marker. For more information about this technique, refer to the Custom Chart Series Markers on this site.
|
Peltier Technical Services, Inc.Commercial Utilities | Custom Solutions | Training | Charts and Tutorials | PTS BlogPeltier Technical Services, Inc., Copyright © 2010. All rights reserved. |