Microsoft KB Archive/178545

= PRB: Cannot Set Marker Size or Style for MSChart =

Article ID: 178545

Article Last Modified on 3/10/2005

-

APPLIES TO


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

-



This article was previously published under Q178545



SYMPTOMS
Setting the Size or Style properties of the marker object in the Microsoft Chart control at run-time does not result in size or style changes.



CAUSE
The SeriesMarker Auto Property is set to True by default.



RESOLUTION
Set the SeriesMarker Auto Property to False.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The following section demonstrates how to create a sample project that modifies properties of Markers on an MSChart control.

Step-by-Step Example
 Start a new Standard EXE project. Form1 is created by default. Click Components on the Project menu, and then select "Microsoft Chart Control." Add an MSChart control and a CommandButton to Form1. Set the ChartType property of the MSChart control to 3-vtChChartType2dLine.  Add the following code to Form1: Option Explicit

Private Sub Command1_Click Dim x As Integer, y As Integer Dim s As Series MSChart1.RowCount = 10 MSChart1.ColumnCount = 4

For y = 1 To 4 MSChart1.Column = y           For x = 1 To 10 MSChart1.Row = x               MSChart1.Data = x * y            Next x

With MSChart1.Plot.SeriesCollection.Item(y) 'The next line is required to change the Marker properties. .SeriesMarker.Auto = False .DataPoints.Item(-1).Marker.Visible = True .DataPoints.Item(-1).Marker.Size = 60 .DataPoints.Item(-1).Marker.Style = VtMarkerStyleX .DataPoints.Item(-1).Marker.Pen.VtColor.Red = 0 .DataPoints.Item(-1).Marker.Pen.VtColor.Blue = 0 .DataPoints.Item(-1).Marker.Pen.VtColor.Green = 0 End With Next y

End Sub

</li> Press the F5 key to run the project.</li> Click Command1. Note that the Marker style and size do not change.</li></ol>

<div class="references_section">