Mouse On Contour Line

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Rajesh Dhiman
Newbie
Newbie
Posts: 15
Joined: Mon Sep 15, 2008 12:00 am

Mouse On Contour Line

Post by Rajesh Dhiman » Thu May 20, 2010 12:56 pm

Hi,

I have contour displayed.

Requirement is that When ever user performs mouse hoover over contour line, Mouse should change to some business icon.

Problem is that T chart is not giving any event like mouse enter or mouse leave on the Contour segments/levels.

Please tell me how to achieve that .

Rajesh Dhiman

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Mouse On Contour Line

Post by Yeray » Thu May 20, 2010 2:31 pm

Hi Rajesh Dhiman,

Is the following achieving what you are trying to do?

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Contour contour = new Steema.TeeChart.Styles.Contour(tChart1.Chart);
            contour.FillSampleValues();

            tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
        }

        void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            int index = tChart1[0].Clicked(e.X, e.Y);

            tChart1.Header.Text = (index > -1) ? index.ToString() : "TeeChart";
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rajesh Dhiman
Newbie
Newbie
Posts: 15
Joined: Mon Sep 15, 2008 12:00 am

Re: Mouse On Contour Line

Post by Rajesh Dhiman » Fri May 21, 2010 6:59 am

HI Yeray,
Thanks for your reply,

Here is the bug in TChart. Clicked Method always return -1 irrespective of the mouse position.
Even mouse pointer is over the contour line it returns -1. I tried with zoomed data also, result is same.

Please confirm that and let me know where to change in Tchart code as well.

Below is the code snippet I used
.
private void tChart_MouseMove(object sender, MouseEventArgs e)
{

int index = tChart[0].Clicked(e.GetPosition(tChart).X, e.GetPosition(tChart ).Y);

tChart.Header.Text = index.ToString();

}

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Mouse On Contour Line

Post by Yeray » Fri May 21, 2010 9:06 am

Hi Rajesh Dhiman,

Could you please tell us what exact TeeChart version and IDE are you using?
I've added to the wish list to study the possibility for the clicked method to give the level "zone", not only the line (TF02014905).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rajesh Dhiman
Newbie
Newbie
Posts: 15
Joined: Mon Sep 15, 2008 12:00 am

Re: Mouse On Contour Line

Post by Rajesh Dhiman » Fri May 21, 2010 9:47 am

Release Notes 24th September 2009
TeeChart.NET version 2009
Build 4.0.2009.35592
Compiled for Visual Studio 2008
Build 4.0.2009.35591
Compiled in .NET Framework 2.0
Build 4.0.2009.35590
Compiled in .NET Framework 1.0

IDE--> MS-VS2008

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Mouse On Contour Line

Post by Yeray » Fri May 21, 2010 11:10 am

Hi Rajesh Dhiman,

Have you tried the example code I posted above in a new simple VS2008 C# WinForms application?
Here it works fine with TeeChart for .NET v4.0.2009.35592.

On the other hand, I'd recommend you to upgrade your TeeChart for .NET to the latest maintenance release available at the client area
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rajesh Dhiman
Newbie
Newbie
Posts: 15
Joined: Mon Sep 15, 2008 12:00 am

Re: Mouse On Contour Line

Post by Rajesh Dhiman » Mon May 24, 2010 4:45 am

Hi Yeray.

We are creating WPF application not the Win-Form Application.

It will be great if you check for WPF appplication as well.

Regards,

Rajesh Dhiman

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Mouse On Contour Line

Post by Yeray » Mon May 24, 2010 1:47 pm

Hi Rajesh Dhiman,

Yes, I've seen that the same code works fine with WinForms while in WPF doesn't return the correct index, so I've added it to the defect list to be fixed in future releases (TW16014909).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply