Points Chart Clicked Pointer
Posted: Tue Nov 09, 2010 10:49 pm
Hi,
I am loading data into a points chart:
Sub PlotPoints1
Points1.Chart.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto
Points1.Chart.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto
Points1.Clear()
Points1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Points1.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Dim i As Long
For i = 0 To Numberofsamples
Points1.Add(XDataA(i ), YData(i), "", Colorofsample(i ))
Next i
End Sub
I plan on using the annotation callout to track pointer data. I have this feature working for the ternary plots.
Now I need a points chart.
I cannot get the Points1_ClickPointer event to fire when the pointer is clicked on a points chart. Please check. I have tried in an existing project and in a new project starting from scratch.
Private Sub Points1_ClickPointer(ByVal series As Steema.TeeChart.Styles.CustomPoint, ByVal valueIndex As Integer, ByVal x As Integer, ByVal y As Integer) Handles Points1.ClickPointer
SetCallout(valueIndex, x, y)
End Sub
Private Sub SetCallout(ByVal AIndex As Integer, ByVal x As Integer, ByVal y As Integer)
Dim tmp1 As String, tmp2 As String
tmp1 = Points1.XValues(AIndex)
tmp2 = Points1.YValues(AIndex)
tmp1 = Format(Val(tmp1), "##0")
tmp2 = Format(Val(tmp2), "##0")
AnnotationChart4.Text = String.Format("Point: {0} {4}Value: {1} {2}", AIndex.ToString() + 1, tmp1, tmp2, vbCrLf)
' Re-position annotation callout
AnnotationChart4.Callout.ArrowHead = Steema.TeeChart.Styles.ArrowHeadStyles.Line
AnnotationChart4.Active = True
With AnnotationChart4.Callout
.Visible = True
.XPosition = x
.YPosition = y
.ZPosition = 0
End With
End Sub
I am loading data into a points chart:
Sub PlotPoints1
Points1.Chart.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto
Points1.Chart.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto
Points1.Clear()
Points1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Points1.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Dim i As Long
For i = 0 To Numberofsamples
Points1.Add(XDataA(i ), YData(i), "", Colorofsample(i ))
Next i
End Sub
I plan on using the annotation callout to track pointer data. I have this feature working for the ternary plots.
Now I need a points chart.
I cannot get the Points1_ClickPointer event to fire when the pointer is clicked on a points chart. Please check. I have tried in an existing project and in a new project starting from scratch.
Private Sub Points1_ClickPointer(ByVal series As Steema.TeeChart.Styles.CustomPoint, ByVal valueIndex As Integer, ByVal x As Integer, ByVal y As Integer) Handles Points1.ClickPointer
SetCallout(valueIndex, x, y)
End Sub
Private Sub SetCallout(ByVal AIndex As Integer, ByVal x As Integer, ByVal y As Integer)
Dim tmp1 As String, tmp2 As String
tmp1 = Points1.XValues(AIndex)
tmp2 = Points1.YValues(AIndex)
tmp1 = Format(Val(tmp1), "##0")
tmp2 = Format(Val(tmp2), "##0")
AnnotationChart4.Text = String.Format("Point: {0} {4}Value: {1} {2}", AIndex.ToString() + 1, tmp1, tmp2, vbCrLf)
' Re-position annotation callout
AnnotationChart4.Callout.ArrowHead = Steema.TeeChart.Styles.ArrowHeadStyles.Line
AnnotationChart4.Active = True
With AnnotationChart4.Callout
.Visible = True
.XPosition = x
.YPosition = y
.ZPosition = 0
End With
End Sub