PRB: MSChart Legend Text Gets Truncated

Last reviewed: November 12, 1997
Article ID: Q176632
The information in this article applies to:
  • Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0

SYMPTOMS

When you change the ColumnLabel property of an MSChart control at run-time, the text in the legend appears truncated.

RESOLUTION

To work around this property, you can change the legend text at run-time by setting the LegendText property of the Series:

   MSChart1.Plot.SeriesCollection(1).LegendText = "My Legend Text"

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start a new Standard EXE project. Form1 is created by default.

  2. Click Components on the Project menu, and check "Microsoft Chart Control."

  3. Add an MSChart control to Form1.

  4. Set the ShowLegend property of MSChart1 to True.

  5. Add the following code to the Load event of Form1:

          Dim i as Integer
          For i = 1 To MSChart1.Plot.SeriesCollection.Count
    
             MSChart1.Column = i
             MSChart1.ColumnLabel = "Legend Text " & i
          Next
    
    

  6. Press the F5 key to run the project. Note that the text in the legend is truncated.

To work around the problem with this example, change the following line of code:

   MSChart1.ColumnLabel = "Legend Text " & i

to:

   MSChart1.Plot.SeriesCollection(i).LegendText = "Legend Text " & i


Additional query words: graph charting
Keywords : vb5all VBKBAX VBKBComp VBKBCtrl
Version : WINDOWS:5.0
Platform : WINDOWS
Issue type : kbprb
Solution Type : kbpending


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.