teechart根据索引取得XY坐标的值
时间:2022-07-24 00:18
浏览:0
评论:0
直接上代码
Public Sub grLogAxis(caption As String, log As Integer) TChart1.Axis.Left.Logarithmic = True TChart1.Axis.Left.LogarithmicBase = log End Sub Public Function grGetSampleValue(s, Axis, p) Dim i For i = 0 To TChart1.SeriesCount - 1 With TChart1.Series(i) If .Title = s Then If Axis = 0 Then grGetSampleValue = .PointLabel(p) If Axis = 1 Then grGetSampleValue = .YValues.value(p) End If End With Next End Function
我是要根据索引取得X轴的LABLE,然后处理后给颜色
原来一直用.xValue(Index),结果其实得到的还是Index
原来是用的取点的lable值
过程很漫长,结果非常好