vb6.0 Mschar 获取X轴(注脚)的值、改变图例位置(默认右边)
本帖最后由 smithlzh 于 2011-09-21 13:22:34 编辑
SQL = " SELECT CONVERT (varchar(16), atime ,120) as 日期, float1, float2,, float3 FROM tab1 "
Set RS = Data_Module(SQL)
If Not (RS.BOF = True And RS.EOF = True) Then
RS.MoveFirst
End If
Set SChart1.DataSource = RS
请教: 鼠标点击 Mschar1 .Row 获取该点 日期 的值。
例如:
Private Sub SChart_fire_c1_PointActivated(Series As _
Integer, DataPoint As Integer, MouseFlags As _
Integer, Cancel As Integer)
If Series = 1 Then
Text1.Text = ""
With SChart1
.Column = Series
.Row = DataPoint
.data = InputBox("Change the data point:", , .data)
Text1.Text = "实测:" & .data
Text1.Visible = True
End With
With SChart1
.Column = 2
.Row = DataPoint
Text1.Text = Text1.Text & " Hi:" & .data
Text1.Visible = True
End With
With SChart1
.Column = 3
.Row = DataPoint
Text1.Text = Text1.Text & " Lo:" & .data
Text1.Visible = True
End With
Else
Text1.Text = ""
Text1.Visible = False
End If
End Sub
***********
请教:改变 SChart1 图例显示位置(默认右边); SChart1 的图例在底部(顶部)显示?
[解决办法]
补充说明: SChart1 绑定数据后, SChart1 X轴(注脚)的值能显示出来。但是数据多时, 就看不清楚啦。
[解决办法]
dim dot_id as Integer 'rs 的指针
Private Sub SChart_fire_c1_PointActivated(Series As _
Integer, DataPoint As Integer, MouseFlags As _
Integer, Cancel As Integer)
If Series = 1 Then
dot_id = DataPoint
...
...
End If
End Sub
'调用 rs 指针
rs.movefirst
rs.move dot_id-1
'获取到 日期
rs("日期")
[解决办法]
VB6.0 打印多个SChart方法;同一张纸(例如:A4)
SChart_1.EditCopy
Printer.PaintPicture Clipboard.GetData(), -300, 0
'Printer.EndDoc
SChart_2.EditCopy
Printer.PaintPicture Clipboard.GetData(), -300, 11520 / 2
' Printer.EndDoc
SChart_3.EditCopy
Printer.PaintPicture Clipboard.GetData(), -300, 11520
Printer.EndDoc