For i = 1 To MSChart1.Plot.SeriesCollection.Count
         MSChart1.Plot.SeriesCollection(i).DataPoints.Item(-1).DataPointLabel.LocationType = VtChLabelLocationTypeAbovePoint
        Next i

解决方案 »

  1.   

    The simplest way of plotting a chart is to create an array of numeric values, and then set the ChartData property to the array, as shown in the following example:' This code might be pasted into the Load event 
    ' of a Form that has an MSChart control named 
    ' "MSChart1".
    Dim arrPrices(1 to 10)
    Dim i As Integer
    For i = 1 to 10
       arrPrices(i)= i * 2
    Next i
    MSChart1.ChartData = arrPricesTo create a more complex, multi-series chart, you must create a multi-dimensioned array, as shown in the following example:' The number of series are determined by the second
    ' dimension. In this example, the chart will have two
    ' series, with five data points in each series.
    Dim arrPriceQuantity(1 to 5, 1 to 2)
    Dim i as Integer
    For i = 1 to 5
       arrPriceQuantity(i, 1) = i ' Series 1
       arrPriceQuantity(i, 2) = 0 - i ' Series 2
    Next i
    MsChart1.ChartData = arrPriceQuantityPrivate Sub MSChart1_PointActivated(Series As _
       Integer, DataPoint As Integer, MouseFlags As _
       Integer, Cancel As Integer)
       With MSChart1
          .Column = Series
          .Row = DataPoint
          .Data = InputBox _
          ("Change the data point:", , .Data)
       End With 
    End Sub--------------------------------------------------------------------------------
    Once you have created a chart, using an array from a spreadsheet or other data source, you may also want to set or return the value of a particular data point. This can be done by first setting the Row and (if applicable) Column properties, then setting or returning the Data property. For example, in a simple (single-series) chart, the following code would change the third data point.With MSChart1
       ' Change third data point to 50.
       .Row = 3
       .Data = 50 
    End With
      

  2.   

    http://www.dapha.net/down/list.asp?id=764