Page 1 of 1
One point plotting on top of another
Posted: Wed Sep 24, 2008 4:15 pm
by 8119969
I have a point series that has two points with the same x and y value. When they are plotted they are plotted on top of each other. I would like to be able to tell there are two points there, so I would like the one on the bottom to big bigger in diameter. I am using circles, vb.net, tchart version 1.1.2004.16592. I would love to upgrade to the latest tchart, but since there are 3 developers, I can only upgrade when the other developers upgrade.
Posted: Thu Sep 25, 2008 8:58 am
by narcis
Hi John,
In v1 you can do this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Points points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
points1.ColorEach = true;
points1.Pointer.VertSize = 5;
points1.Pointer.HorizSize = 5;
points1.Add(1, 1);
points1.Add(1, 1);
points1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(points1_GetPointerStyle);
}
void points1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs e)
{
if (e.ValueIndex == 1)
{
series.Pointer.VertSize = 3;
series.Pointer.HorizSize = 3;
}
}
The point that I want to find is not the first point
Posted: Thu Sep 25, 2008 7:53 pm
by 8119969
This works great if you only have the two points. However, the point I want to find is not the first point, but towards the middle. I have included the sample program that I am using to try and find the correct point. What am I doing wrong?
Thanks!
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim points1 As New Steema.TeeChart.Styles.Points
Dim line1 As New Steema.TeeChart.Styles.Line
' points1.ColorEach = True
points1.Pointer.VertSize = 5
points1.Pointer.HorizSize = 5
points1.Add(2, 5620)
points1.Add(2, 5910)
points1.Add(2, 5890)
points1.Add(3, 3840)
points1.Add(3, 3920) ' this is the point that should be bigger
points1.Add(3, 3920)
points1.Add(4, 5720)
points1.Add(4, 5550)
points1.Add(4, 5510)
points1.Add(5, 5190)
points1.Add(5, 5170)
points1.Add(5, 5110)
points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
line1.Add(2, 5620)
line1.Add(2, 5910)
line1.Add(2, 5890)
line1.Add(3, 3840)
line1.Add(3, 3920)
line1.Add(3, 3920)
line1.Add(4, 5720)
line1.Add(4, 5550)
line1.Add(4, 5510)
line1.Add(5, 5190)
line1.Add(5, 5170)
line1.Add(5, 5110)
TChart1.Series.Add(points1)
TChart1.Series.Add(line1)
AddHandler points1.GetPointerStyle, AddressOf GetPointerStyle
End Sub
Private Sub GetPointerStyle(ByVal series As Steema.TeeChart.Styles.CustomPoint, ByVal e As Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs)
If (e.ValueIndex = 1) Then
series.Pointer.VertSize = 3
series.Pointer.HorizSize = 3
End If
End Sub
End Class
Posted: Fri Sep 26, 2008 7:46 am
by narcis
Hi John,
In that case you can do this:
Code: Select all
Dim index As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim points1 As New Steema.TeeChart.Styles.Points
Dim line1 As New Steema.TeeChart.Styles.Line
' points1.ColorEach = True
points1.Pointer.VertSize = 5
points1.Pointer.HorizSize = 5
points1.Add(2, 5620)
points1.Add(2, 5910)
points1.Add(2, 5890)
points1.Add(3, 3840)
index = points1.Add(3, 3920) ' this is the point that should be bigger
points1.Add(3, 3920)
points1.Add(4, 5720)
points1.Add(4, 5550)
points1.Add(4, 5510)
points1.Add(5, 5190)
points1.Add(5, 5170)
points1.Add(5, 5110)
points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
line1.Add(2, 5620)
line1.Add(2, 5910)
line1.Add(2, 5890)
line1.Add(3, 3840)
line1.Add(3, 3920)
line1.Add(3, 3920)
line1.Add(4, 5720)
line1.Add(4, 5550)
line1.Add(4, 5510)
line1.Add(5, 5190)
line1.Add(5, 5170)
line1.Add(5, 5110)
TChart1.Series.Add(points1)
TChart1.Series.Add(line1)
AddHandler points1.GetPointerStyle, AddressOf GetPointerStyle
End Sub
Private Sub GetPointerStyle(ByVal series As Steema.TeeChart.Styles.CustomPoint, ByVal e As Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs)
If (e.ValueIndex = index) Then
series.Pointer.VertSize = 5
series.Pointer.HorizSize = 5
Else
series.Pointer.VertSize = 3
series.Pointer.HorizSize = 3
End If
End Sub