MouseEnter event question

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
greggL
Newbie
Newbie
Posts: 5
Joined: Mon Sep 17, 2012 12:00 am

MouseEnter event question

Post by greggL » Tue Oct 16, 2012 6:22 pm

Hello,
I've read a few threads on similar questions, but I'm still confused. I'm having trouble using the MouseEnter events when I have multiple series that overlap. Specifically, if I have an Area series and Points series and they have a common data point, when I mouse over that point the MouseEnter event is only triggered for the series that was added first, and which is plotted behind the other series.

For example if I add the Area series first, then add the Points series, the Points will be plotted on top, but only the Area MouseEnter event is triggered.

In another thread, it was suggested that every series at that point would trigger its MouseEnter event, but in my case with the Area and Points series, this doesn't seem to be true. The top series event does not fire at all. (I think the person in the other thread was using multiple line series).

In a different thread, I also saw a suggestion to use the chart MouseMove event together with Series.Clicked. I looks like I could make this would work if necessary, but it would be more convenient if I could handle it with the series events. I will be dynamically plotting and removing many series, and each will have it's own specific mouse behavior so I'd rather not have to use Chart events.

In summary, I would like to have the Points series plotted on top of the Area series then use the Points MouseEnter event. Anything I can do?

I'm using TeeChart .NET 4.1.2011.10190

Thanks,
Gregg

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: MouseEnter event question

Post by Sandra » Wed Oct 17, 2012 12:19 pm

Hello greggL,

I can reproduce your problem using last version of TeeChartFor.Net and same data with Area and Point Series and in your case, I suggest you use MouseMove in a dynamic way, e.g: using last series you have added in chart to use clicked method in mouse move. Please see next code:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Area area1;
        Steema.TeeChart.Styles.Points point1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
            point1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);

            area1.FillSampleValues();
            point1.DataSource = area1;
            point1.RefreshSeries();
            tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
        }

        void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            if (tChart1[tChart1.Series.Count - 1].Clicked(e.X, e.Y) != -1)
            {
                tChart1.Header.Text = "Mouse Point Series Enter";
            }
            else
            {
                tChart1.Header.Text = "TeeChart";
            }
           
        }
Could you tell us if previous code works in your end? If it doesn't like you, please try to arrange a simple project because we can work with it to find a good solution for you.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

greggL
Newbie
Newbie
Posts: 5
Joined: Mon Sep 17, 2012 12:00 am

Re: MouseEnter event question

Post by greggL » Wed Oct 17, 2012 9:51 pm

Hi Sandra,
Thanks for the reply. That's the same suggestion I saw in the other thread. I think that I can make it work.
Can you explain what is happening with the MouseEnter event here? I'd like to better understand the behavior of the series events so that I can use them effectively in the future.
Thanks again,
Gregg

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: MouseEnter event question

Post by Sandra » Thu Oct 18, 2012 12:03 pm

Hello greggL,

The description of MouseEnter tell this event is called when the mouse cursor "enters" into any point of the series. So, we consider, after doing many test,the MouseEnger have a bug that we have already fixed. Therefore, in next maintenance release of TeeChartFor.Net the problem is fixed and the MouseEnter triggered for each series.

Thanks,
Best Regards,
Sandra Pazos / 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