Microsoft KB Archive/176632

= FIX: MSChart Legend Text Gets Truncated =

Article ID: 176632

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q176632



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 has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0.



Steps to Reproduce Behavior
 Start a new Standard EXE project. Form1 is created by default. Click Components on the Project menu, and check "Microsoft Chart Control." Add an MSChart control to Form1. Set the ShowLegend property of MSChart1 to True.  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

 Press the F5 key to run the project. Note that the text in the legend is truncated.</li></ol>

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 kbVBp500bug kbVBp600fix kbVBp kbdsd kbDSupport kbControl

Keywords: kbbug kbfix KB176632

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.