Page 1 of 1

Events available related to AxisScroll

Posted: Tue Jun 14, 2011 9:14 am
by 14050297
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

Re: Events available related to AxisScroll

Posted: Wed Jun 15, 2011 2:53 pm
by 10050769
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,

Re: Events available related to AxisScroll

Posted: Thu Jun 16, 2011 7:00 am
by 14050297
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

Re: Events available related to AxisScroll

Posted: Fri Jun 17, 2011 8:56 am
by 10050769
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,

Re: Events available related to AxisScroll

Posted: Wed Jun 22, 2011 9:21 am
by 14050297
Thanks for the reply

Regards
- JC