is there any way to defect fastline between two points

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

is there any way to defect fastline between two points

Post by Pradip » Tue Sep 20, 2011 10:13 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: is there any way to defect fastline between two points

Post by Narcís » Tue Sep 20, 2011 11:39 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: is there any way to defect fastline between two points

Post by Pradip » Tue Sep 20, 2011 2:21 pm

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#

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: is there any way to defect fastline between two points

Post by Narcís » Tue Sep 20, 2011 3:05 pm

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 :shock:. 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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: is there any way to defect fastline between two points

Post by Pradip » Tue Sep 20, 2011 3:10 pm

Thanks Narcís .


Its working now

Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: is there any way to defect fastline between two points

Post by Pradip » Wed Sep 21, 2011 8:48 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: is there any way to defect fastline between two points

Post by Narcís » Wed Sep 21, 2011 8:55 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: is there any way to defect fastline between two points

Post by Pradip » Wed Sep 21, 2011 3:31 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: is there any way to defect fastline between two points

Post by Narcís » Thu Sep 22, 2011 7:40 am

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();
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply