Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21686

[RESOLVED] MSChart plots an unexisting point

$
0
0
Hello:

I have the following VB6 code to get a scatter chart with MSChart:

HTML Code:

Private Sub Form_Load()
Form1.Show
' POINTS
Dim Graph(1 To 41, 1 To 2) As Single

            Graph(1, 1) = -9  ' value for X-axis
            Graph(2, 1) = -5
            Graph(3, 1) = 9
            Graph(4, 1) = 9
            Graph(5, 1) = 18
            Graph(6, 1) = 9
            Graph(7, 1) = 9
            Graph(8, 1) = 0
            Graph(9, 1) = 0
            Graph(10, 1) = -18
            Graph(11, 1) = -9
            Graph(12, 1) = -9
           
            Graph(1, 2) = -15  ' value for X-axis
            Graph(2, 2) = -11
            Graph(3, 2) = -14
            Graph(4, 2) = -6
            Graph(5, 2) = -3
            Graph(6, 2) = 0
            Graph(7, 2) = 8
            Graph(8, 2) = 12
            Graph(9, 2) = 4
            Graph(10, 2) = -4
            Graph(11, 2) = -7
            Graph(12, 2) = -15
 
 ' GRAPH
        MSChart1.chartType = VtChChartType2dXY  ' set to X Y Scatter chart
        MSChart1 = Graph
 
  ' DATA POINTS SHOW
    With MSChart1
      .Plot.Axis(VtChAxisIdX).Labels(1).VtFont.Size = 8
      End With
         
    'PLOT AREA COLOR
      With MSChart1.Plot
      ' Set style to solid.
      .Wall.Brush.Style = VtBrushStyleSolid
      ' Set color .
      .Wall.Brush.FillColor.Set 221, 217, 195
   
    'DATA POINTS SHOW & COLOR AND SERIE COLOR
        With .SeriesCollection
        With .Item(1).DataPoints(-1)
        .DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
        .DataPointLabel.VtFont.VtColor.Set 0, 0, 0 '# black
        .Brush.FillColor.Set 165, 0, 33
        End With
        End With '#seriescoll
      End With
     
      With MSChart1.Plot.Backdrop
    ' Property to VtFillStyleBrush.
      .Fill.Style = VtFillStyleBrush
      .Fill.Brush.FillColor.Set 197, 190, 151
      ' Border.
      .Frame.Style = VtFrameStyleThickInner
      ' Set shadow.
      .Shadow.Style = VtShadowStyleDrop
    End With

End Sub

The problem: the chart plots a line from unexisting Graph (0,0) point to the one my example begins with, Graph (1,1=-9;Graph(1,2)=-15).

Unsuccessfully, I have been trying to get rid off that.

I thank any help I could get.

Nelson

Viewing all articles
Browse latest Browse all 21686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>