1、横纵坐标的范围是不是跟picture控件的Scaleheight和Scalewidth的值一样,由这两个属性决定。 说明:曲线图是在picture中画的
2、实际在绘制时用两个变量Xp,Yp,Xp表示前后实际值的坐标变化,Yp表示得到的实际值,请问Xp,Yp的变化范围。说明:是不是Xp变化范围同picture控件的Scalewidth,Yp的值为实际测量值。

解决方案 »

  1.   

    这是采用的局部坐标,系统默认的是pixture的左上方为0,0。
    可以使用pset(x,y)进行绘制画图。
    第二个问题没搞错吧?
    如果那样你无法确认方向的。
    如果是画线,用LINE(X1,Y1,X2,Y2)
      

  2.   

    我自己已经做好了坐标系,类似windows任务管理器的那种
      

  3.   

    变化范围你可以取 这段时间的最大值和最小值 
    下面是 我做的外汇牌价的走势图   去的是最近40天的值 
    给你参考下(如果有用的话)Dim x As Double
    Dim y As Double
    Dim x1 As Double
    Dim y1 As Double
    Dim x2 As Double
    Dim y2 As Double
    Dim i As Long
    Dim MaxJ As Double
    Dim MinJ As Double
    Dim j(40, 2) As Double
    Dim t As Integer
    Dim bl As Double
    MaxJ = 0
    MinJ = 10000000
    Dim r As New ADODB.Recordset
    Dim SQL As String
    Picture1.Cls
    SQL = "select top 40 * from waihui where hb='" & List1 & "' order by rq  desc"
    r.Open SQL, cn
    If Not (r.EOF And r.BOF) Then
    Picture1.DrawWidth = 1
        '中间的水平线
        Picture1.Line (0, Picture1.Height / 2)-(Picture1.Width, Picture1.Height / 2), QBColor(12)
      '画40根素县
        For i = 1 To 40
            Picture1.Line (i * Picture1.Width / 41, 0)-(i * Picture1.Width / 41, Picture1.Height), QBColor(8)
        Next
        i = 0
    '读出到数珠
        Do While Not r.EOF
         i = i + 1
         j(i, 1) = r!mcj
         j(i, 2) = r!xhmr
          If MaxJ < r!mcj Then MaxJ = r!mcj
          If MinJ > r!xhmr Then MinJ = r!xhmr
        r.MoveNext
        Loop
    t = iPicture1.DrawWidth = 3
    '画第一根线
    For i = t To 1 Step -1
        x = (t - i) * Picture1.Width / 41
        y = 0.8 * Picture1.Height * (MaxJ - j(i, 1)) / (MaxJ - MinJ) + 0.1 * Picture1.Height
        If y1 = 0 Then y1 = y
        y2 = y
        x2 = x
        Picture1.Line (x1, y1)-(x2, y2), QBColor(12)
        y1 = y2
        x1 = x2
    Next
    x1 = 0
    y1 = 0
    '画第二根线For i = t To 1 Step -1
        x = (t - i) * Picture1.Width / 41
        y = 0.8 * Picture1.Height * (MaxJ - j(i, 2)) / (MaxJ - MinJ) + 0.1 * Picture1.Height
        If y1 = 0 Then y1 = y
        y2 = y
        x2 = x
        Picture1.Line (x1, y1)-(x2, y2), QBColor(10)
        Debug.Print i - t, , x1, y1, x2, y2    y1 = y2
        x1 = x2
    Next
    Picture1.Line (0, 0)-(10, 10), QBColor(10)
    Picture1.ForeColor = QBColor(15)
    Picture1.Print List1 & " 在40天内最高价:" & MaxJ & "最低价:" & MinJ
    End Ifr.Close
    cn.Close