Events available related to AxisScroll

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

Events available related to AxisScroll

Post by VarUser » Tue Jun 14, 2011 9:14 am

Hi

I am using AxisScroll in the chart.
Is there any event which is raised when I drag my mouse over the axis. The axis moves automatically but I want to do some thing more when user will drag mouse over the axis.
Is there any way by which I can detect that user is scrolling using AxisScroll.

Regards
- JC

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

Re: Events available related to AxisScroll

Post by Sandra » Wed Jun 15, 2011 2:53 pm

Hello VarUser,

You can do something using Chart events, as next code, where use AxesClick event to detected axes work as you want work:

Code: Select all

        private Steema.TeeChart.Styles.Bar bar1;
        private Steema.TeeChart.Tools.AxisScroll axisScroll1;

        void InitializeChart()
        {
            bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues();

            axisScroll1 = new Steema.TeeChart.Tools.AxisScroll(tChart1.Chart);
            tChart1.ClickAxis += new MouseEventHandler(tChart1_ClickAxis);
        }

        void tChart1_ClickAxis(object sender, MouseEventArgs e)
        {
            if (tChart1.Axes.Bottom == sender)
            {
                axisScroll1.Active = true;
            }
            else
            {
                axisScroll1.Active = false;
            }
        }
Could you confirm us if previous code works as you expected?

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

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Events available related to AxisScroll

Post by VarUser » Thu Jun 16, 2011 7:00 am

Hi Sandra

Thanks for your reply.

One related query.
We have handled tChart.Zoomed event and when we use AxisScroll to scroll the data, this event handler for Zoomed is un-necessarily getting called.
This means that even when we scroll the data(using AxisScroll) zoomed event is raised. Is there any way to get rid of this.

Regards
- JC

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

Re: Events available related to AxisScroll

Post by Sandra » Fri Jun 17, 2011 8:56 am

Hello VarUser,
We have handled tChart.Zoomed event and when we use AxisScroll to scroll the data, this event handler for Zoomed is un-necessarily getting called.
This means that even when we scroll the data(using AxisScroll) zoomed event is raised. Is there any way to get rid of this.
I have made simple project using Zoomed and Scroll events where respectively disable and enable AxisScroll:

Code: Select all

     private Steema.TeeChart.Styles.Bar bar1;
        private Steema.TeeChart.Tools.AxisScroll axisScroll1;

        void InitializeChart()
        {
            bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues();
            axisScroll1 = new Steema.TeeChart.Tools.AxisScroll(tChart1.Chart);
            tChart1.Scroll += new EventHandler(tChart1_Scroll);
            tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
        }

        void tChart1_Zoomed(object sender, EventArgs e)
        {
            axisScroll1.Active = false;
        }

        void tChart1_Scroll(object sender, EventArgs e)
        {
            axisScroll1.Active = true;
        }
Could you confirm us if previous code works as you expected?

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

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Events available related to AxisScroll

Post by VarUser » Wed Jun 22, 2011 9:21 am

Thanks for the reply

Regards
- JC

Post Reply