Page 1 of 1

Mouse On Contour Line

Posted: Thu May 20, 2010 12:56 pm
by 13050301
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

Re: Mouse On Contour Line

Posted: Thu May 20, 2010 2:31 pm
by yeray
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";
        }

Re: Mouse On Contour Line

Posted: Fri May 21, 2010 6:59 am
by 13050301
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();

}

Re: Mouse On Contour Line

Posted: Fri May 21, 2010 9:06 am
by yeray
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).

Re: Mouse On Contour Line

Posted: Fri May 21, 2010 9:47 am
by 13050301
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

Re: Mouse On Contour Line

Posted: Fri May 21, 2010 11:10 am
by yeray
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

Re: Mouse On Contour Line

Posted: Mon May 24, 2010 4:45 am
by 13050301
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

Re: Mouse On Contour Line

Posted: Mon May 24, 2010 1:47 pm
by yeray
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).