XL2000: Data Labels on Chart Appear Outside the Plot Area

ID: Q213888


The information in this article applies to:
  • Microsoft Excel 2000


SYMPTOMS

When you display data labels on a chart, some of the data labels appear outside the plot area.


CAUSE

This problem occurs when the following conditions are true:

  • You display the data values for the data points on a chart.

    -and-


  • You adjust the scale of the y axis on the chart so that the maximum value of the scale is smaller than a data value in the chart.

    -or-


  • You adjust the scale of the y axis on the chart so that the minimum value of the scale is larger than a data value in the chart.


When this problem occurs, the data point is not displayed, but the data value label is displayed at the top of the chart outside the plot area.


WORKAROUND

To work around this problem, use either of the following methods.

Method 1: Manually Delete the Excess Data Value Labels

To work around this problem, delete the data value labels independently. To do this, follow these steps:
  1. Click any one of the data value labels. This step selects the entire data series.


  2. Click any one of the data value labels that you want to delete.

    By doing this you select a single data label.


  3. On the Edit menu, point to Clear and click All.

    One data value label is deleted.


You must repeat this process for each data value label that you want to delete.

Method 2: Use a Macro to Delete the Excess Data Value Labels

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
This method uses a macro to delete all of the data value labels that appear outside of the plot area. To use this method, you must insert a module and then type the code that follows these steps:

  1. Save and close any open workbooks, and then create a new workbook.


  2. Start the Visual Basic Editor (press ALT+F11).


  3. On the Insert menu, click Module.


  4. Then, type the following code:

    
    Sub Del_Label()
        ' Detect and store the top location of plot area.
        y = ActiveChart.PlotArea.Top
        ' Loop through all labels in series one.
        For Each y_label In ActiveChart.SeriesCollection(1).DataLabels
           ' Test if label is above top of the plot area.
           If y_label.Top < y Then
              ' Select and delete a label.
              y_label.Select
              y_label.Delete
           End If
        Next y_label
    End Sub 
  5. Select the chart before running the Del_Label macro.



STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

Additional query words: wrap appear XL2000

Keywords : kbdta kbchart
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: August 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.