teechart控件 多轴曲线 缩放 及数值显示?

marshvee 2012-09-28 04:18:39

For i = 1 To 5
With TChart1.Axis
.Left.StartPosition = 2
numVertaxis = .AddCustom(False)
numHorizaxis = .AddCustom(True)

With .Custom(numVertaxis)
.StartPosition = N * 10
.EndPosition = .StartPosition + 5
End With

With .Custom(numHorizaxis)
.StartPosition = 0
.EndPosition = 98
End With
End With

Idx = TChart1.AddSeries(scFastLine)
With TChart1.Series(Idx)
.AddArray 500, Array() '
.VerticalAxisCustom = numVertaxis
.HorizontalAxisCustom = numHorizaxis
End With
N = N + 1
End If
Next



使用如上代码,我实现了多个曲线的显示。但是有2个功能没有实现,从网上找了些实例,没有发现类似用法。
1、这些曲线的缩放。(本来只有单一坐标轴时是自动的,现在鼠标如何动作都没反应)
2、 当鼠标经过时显示所在点的Y轴数值,
请问应如何实现。

...全文
597 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yskshift 2014-12-17
  • 打赏
  • 举报
回复
请问除了teechart,还有别的控件能实现这样的功能吗
cqq_chen 2012-12-08
  • 打赏
  • 举报
回复
问下,这东东稳定吗? 用过一段,一直不太稳定,很容易就....
abc001nba 2012-12-06
  • 打赏
  • 举报
回复
解决你第二个问题:给你一个例子 Private Sub TChart2_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long) Dim somebar As Single ‘定义变量 With TChart2.Series(0) somebar = .Clicked(X, Y) ’获得鼠标点击的地方的坐标 If somebar <> -1 Then ‘判断,没有什么具体意义 Label27.ForeColor = .PointColor(somebar) ’标签中字体颜色和点击的系列相同 Label27.Caption = Format(.XValues.Value(somebar) + 3, "0000") + "相对误差:" + Format(.YValues.Value(somebar), "0.0") + " %" ‘显示坐标 End If End With With TChart2.Series(1) somebar = .Clicked(X, Y) If somebar <> -1 Then Label27.ForeColor = .PointColor(somebar) Label27.Caption = Format(.XValues.Value(somebar) + 3, "0000") + "计算流量:" + Format(.YValues.Value(somebar), "0.0") + " m3/s" End If End With With TChart2.Series(2) somebar = .Clicked(X, Y) If somebar <> -1 Then Label27.ForeColor = .PointColor(somebar) Label27.Caption = Format(.XValues.Value(somebar) + 3, "0000") + "雨量:" + Format(.YValues.Value(somebar), "0.0") + " mm" End If End With End Sub
贝隆 2012-09-28
  • 打赏
  • 举报
回复
多条曲线最好还是自己通过Picturebox绘制。

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧