投稿

teechart根据索引取得XY坐标的值

kittenchen TeeChart
2022-07-24 0 12

直接上代码

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值

过程很漫长,结果非常好

image

文章为作者原创,不要转载哦!

首页 编程信息 TeeChart teechart根据索引取得XY坐标的值

相关文章