Page 1 of 1
is there any way to defect fastline between two points
Posted: Tue Sep 20, 2011 10:13 am
by 13052776
i Have to Show tooltip on fastline if mouse cursor is in the range +/- 1 pixel of the fastLine.
I am able to do it if the XValues are closure to each other but i am not able to defect the fastline if the points are far away from each other.
e.g.
I have two point on FastLine @ 1.2 and 1.9 if move cursor on 1.9 or 1.2 i am able to show the tooltip.
but if i move cursor on FastLine anywhere between 1.2 to 1.9 i am not able to defect if the mouse cursor is on fastLine
Please help me to resolve this issue.
Re: is there any way to defect fastline between two points
Posted: Tue Sep 20, 2011 11:39 am
by narcis
Hi Pradip,
I'm afraid this is related to the steepness of certain segments. For example, using the code snippet below I can reproduce your problem.
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scFastLine
TChart1.Series(0).Add 1, "", clTeeColor
TChart1.Series(0).Add 1.2, "", clTeeColor
TChart1.Series(0).Add 1.9, "", clTeeColor
TChart1.Series(0).Add 2, "", clTeeColor
TChart1.Tools.Add tcMarksTip
End Sub
However it works fine using code below but fails for the last segment then.
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scFastLine
TChart1.Series(0).Add -10, "", clTeeColor
TChart1.Series(0).Add 1.2, "", clTeeColor
TChart1.Series(0).Add 1.9, "", clTeeColor
TChart1.Series(0).Add 20, "", clTeeColor
TChart1.Tools.Add tcMarksTip
End Sub
Moreover, if you use this code:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scFastLine
TChart1.Series(0).Add 1, "", clTeeColor
TChart1.Series(0).Add 1.2, "", clTeeColor
TChart1.Series(0).Add 1.9, "", clTeeColor
TChart1.Series(0).Add 2, "", clTeeColor
TChart1.Tools.Add tcMarksTip
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Index = TChart1.Series(0).Clicked(X, Y)
Me.Caption = CStr(Index)
End Sub
You'll see Clicked method returns the correct value for all segments so I have added the issue (TA05015743) to the defect list to be investigated.
Re: is there any way to defect fastline between two points
Posted: Tue Sep 20, 2011 2:21 pm
by 13052776
i am using
TeeChart version
3.5.3575
i am not getting
TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Index = TChart1.Series(0).Clicked(X, Y)
event with mentioned parameters.
I am working in C#
Re: is there any way to defect fastline between two points
Posted: Tue Sep 20, 2011 3:05 pm
by narcis
Hello Pradip,
So, if I got it right you are using TeeChart for .NET, aren't you? Since you posted this in the TeeChart ActiveX forum I assumed you were using that version
. Anyway, back to the .NET version, code below works fine for me here using latest v3 and v2011 releases. Does this work fine at your end using latest release available?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
tChart1[0].Add(1);
tChart1[0].Add(1.2);
tChart1[0].Add(1.9);
tChart1[0].Add(2);
tChart1.Tools.Add(new Steema.TeeChart.Tools.MarksTip());
}
Thanks in advance.
Re: is there any way to defect fastline between two points
Posted: Tue Sep 20, 2011 3:10 pm
by 13052776
Thanks NarcĂs .
Its working now
Re: is there any way to defect fastline between two points
Posted: Wed Sep 21, 2011 8:48 am
by 13052776
are you going to work on below scenario.
Private Sub Form_Load()
TChart1.AddSeries scFastLine
TChart1.Series(0).Add -10, "", clTeeColor
TChart1.Series(0).Add 1.2, "", clTeeColor
TChart1.Series(0).Add 1.9, "", clTeeColor
TChart1.Series(0).Add 20, "", clTeeColor
TChart1.Tools.Add tcMarksTip
End Sub
when it is not detecting for the first segment.
Re: is there any way to defect fastline between two points
Posted: Wed Sep 21, 2011 8:55 am
by narcis
Hi Pradip,
As I told you yesterday, this works fine for me here using both latest TeeChart for .NET v3 and v2011 releases. Can you please check if latest version available works fine for you?
Thanks in advance.
Re: is there any way to defect fastline between two points
Posted: Wed Sep 21, 2011 3:31 pm
by 13052776
It is working if all the points are in visible area.
but if the point is not in visble area it is not detecting the fastline in last segment
Re: is there any way to defect fastline between two points
Posted: Thu Sep 22, 2011 7:40 am
by narcis
Hi Pradip,
Ok, I could reproduce the problem here using code below and added it (TF02015750) to the defect list to be investigated.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
tChart1[0].Add(-10);
tChart1[0].Add(1.2);
tChart1[0].Add(1.9);
tChart1[0].Add(20);
tChart1.Tools.Add(new Steema.TeeChart.Tools.MarksTip());
tChart1.Axes.Bottom.AutomaticMinimum = false;
tChart1.Axes.Bottom.Minimum = 0.5;
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
this.Text = tChart1[0].Clicked(e.X, e.Y).ToString();
}