如何在vb的图表中实现雷达图?有一些数据,如何在vb的图表中实现雷达图?vb 提供的控件里不能实现这个功能啊请给详细的解答!或者推荐一个什么控件!
多谢

解决方案 »

  1.   

    使用 PictureBox 控件。其中的Circle、Line、PSet 方法可以用来作图。
      

  2.   

    如果MSCHART控件不能满足你的要求的话,就只有通过PICTURE控件自己画了!!
      

  3.   

    Microsoft Office Web Components
      

  4.   

    抽空写了个例子,窗体上放一个picture,一个按钮。拷贝下面的代码就可以了
    Command1_Click()中可以任意定义data数组的元素个数,这样画出来的图也就跟随数据变化,美化方面要自己处理了Option ExplicitPrivate Sub Command1_Click()
        Dim Data() As Integer
        ReDim Data(0 To 5)
        
        Data(0) = 500
        Data(1) = 800
        Data(2) = 300
        Data(3) = 250
        Data(4) = 765
        Data(5) = 999    Radar Data(), 1000
    End SubPrivate Sub Radar(Data() As Integer, Radius As Integer)
        Dim CX As Integer
        Dim CY As Integer
        Dim X1 As Integer
        Dim Y1 As Integer
        
        Dim i As Integer
        
        CX = Picture1.Width / 2
        CY = Picture1.Height / 2
        Picture1.Cls
        
        Picture1.Circle (CX, CY), Radius
        For i = 0 To UBound(Data) - LBound(Data)
            X1 = CX - Cos(i * (360 / (UBound(Data) - LBound(Data) + 1)) / 180 * 3.1415926) * Radius
            Y1 = CY - Sin(i * (360 / (UBound(Data) - LBound(Data) + 1)) / 180 * 3.1415926) * Radius
            Picture1.Line (CX, CY)-(X1, Y1)
        Next
        
        Picture1.CurrentX = CX - Data(LBound(Data))
        Picture1.CurrentY = CY
        
        For i = LBound(Data) To UBound(Data)
            X1 = CX - Cos(i * (360 / (UBound(Data) - LBound(Data) + 1)) / 180 * 3.1415926) * Data(i)
            Y1 = CY - Sin(i * (360 / (UBound(Data) - LBound(Data) + 1)) / 180 * 3.1415926) * Data(i)
            Picture1.Line -(X1, Y1)
        Next
        
        X1 = CX - Data(LBound(Data))
        Y1 = CY
        Picture1.Line -(X1, Y1)
        
    End Sub