Microsoft KB Archive/257710

= FIX: PointSelected of MSChart May Return Wrong DataPoint Value =

Article ID: 257710

Article Last Modified on 8/7/2007

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q257710



SYMPTOMS
If the control type of MSChart is set to Step chart, then the PointSelected event does not always return the right DataPoint value.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx



Steps to Reproduce Behavior
 Create a new Visual Basic Standard EXE project. Form1 is created by default. From the Project menu, choose Components, check Microsoft Chart Control 6.0, and then click OK. Place an MSChart control on Form1.  Paste the following code into Form1's code window: Option Explicit

Private Sub Form_Load Dim i As Integer, j As Integer Dim series As Integer, rows As Integer MSChart1.chartType = VtChChartType2dStep series = 2 rows = 5 With MSChart1.DataGrid .ColumnCount = series .RowCount = rows For i = 1 To series For j = 1 To rows .SetData j, i, j * i, 0 Next j     Next i  End With End Sub

Private Sub MSChart1_PointSelected(series As Integer, DataPoint As Integer, MouseFlags As Integer, Cancel As Integer) MsgBox "Column = " & series & " DataPoint = " & DataPoint End Sub  Press the F5 key to run the program. You should see two graphics plotted, one red and the other green. Click on the last column (R5) on the green graphic to select it. Click again on the last column R5 (near level 9), and note that there is a message box displaying Column=2 and DataPoint=5. This means that you clicked on the second graphic (the green one) and the 5th point (in this case R5). This is the correct behavior.</li> Now click again on the green graphic and over R5, but this time near level 6. Note that the message box column is still 2 (correct), but DataPoint is 4. This is incorrect; it should be 5. This same problem occurs for R4, but not for R1 to R3.</li></ol>

Additional query words: sp4

Keywords: kbbug kbctrl kbfix kbvs600sp4fix kbvs600sp5fix KB257710

-

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

© Microsoft Corporation. All rights reserved.