Cursor Tool Query

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor Tool Query

Post by drillright40 » Fri Feb 06, 2009 7:19 am

Hi,

I am facing the following issue in cursor tool object added in Steema.TeeChart.TChart . The Cursor tool goes out of the boundary of the Histogram when user Right clicks, holds and moves the Histogram towards left or right.

Please Suggest as soon as possible.

Thanks
Sanyog.[/img]

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

Post by Sandra » Fri Feb 06, 2009 9:02 am

Hello, drillright40

If you use right button, you are doing scroll for all objects in Chart no only of Series. Moreover, cursor leave the chart if it is fixed to a position that is outside the scale of the axes.

What I want do it specifically in your program?
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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor tool Query

Post by drillright40 » Fri Feb 06, 2009 10:54 am

Hi,

I have uploaded 2 files related to this Query.Hope this explains the problem.

File1: Histogram Cursortool Outside Right boundary.bmp
File2: Histogram Cursortool Outside Left boundary.bmp

We have to prevent the cursor tool from moving outside the boundary when user right clicks,holds and moves the mouse towards left or right.

Thanks
Sanyog.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 06, 2009 12:10 pm

Hi Sanyog,

In that case you can do use ClipRectange as shown here:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

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

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

			Steema.TeeChart.Tools.CursorTool cursor1 = new Steema.TeeChart.Tools.CursorTool(tChart1.Chart);

			cursor1.YValue = bar1.YValues.Maximum / 2;
			cursor1.XValue = -1;
			cursor1.YValue = bar1.YValues.Maximum / 2;

			tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
			bar1.AfterDrawValues +=new Steema.TeeChart.PaintChartEventHandler(bar1_AfterDrawValues);
		}

		void bar1_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.ClipRectangle(tChart1.Chart.ChartRect);
		}

		void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.ClearClipRegions();
		}
Best Regards,
Narcís Calvet / 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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor tool Query

Post by drillright40 » Mon Feb 09, 2009 5:28 am

Hi,

Thanks for your reply. Implementing those 2 events has solved the problem.But has given rise to another 2 issues.

1.When we move the cursor tool outside the TChart boundary at one point it comes back to the middle of the Plot.Till certain extent it is not seen but after that it comes back to the middle of the Plot.

2.One more line is seen on the left side of the Histogram in some scenarios.I have attached a file "CursorTool3.bmp".Please view it for your reference.

Please reply as soon as possible.
Thanks
Sanyog.

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

Post by Sandra » Mon Feb 09, 2009 9:02 am

Hi Sanyog!

Please, could you send us a simple example project we can run"as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attacment newgroups or at our upload page.



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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor tool Query

Post by drillright40 » Mon Feb 09, 2009 11:33 am

Hi,

OK.I will do that and send it to you as soon as possible.

Meanwhile i have another Query related to Cursor tool Change event.I have observed that when User changes this cusor tool with mouse this event is fired "n" number of times. I mean if User changes the cursor position from lets say "2" to "5", this cusor change is fired many times instead of just one time.

I have a method which is getting called from this Cursor Change event, this method has lots of code and i cannot afford to be invoked so many times.

Please suggest what change i need to do in Cursor change to take care of this scenario.

Thanks
Sanyog.

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

Post by Yeray » Mon Feb 09, 2009 12:07 pm

Hi Sanyog,

We'll be glad to try to help you with your problematic code when you'll send it.

Regarding the number of times the event is fired, I've tested it and seems to be executed once for each cursor position change. If you have too code in this event and you want it to be executed, for example each 5 cursor changes, you could control it with a variable.
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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor tool Query

Post by drillright40 » Mon Feb 09, 2009 1:18 pm

Hi,

I have uploaded the code "Cursor Tool Error.zip". Also find bmp file "CursorToolErrorImage.bmp" for your reference.

Thanks
Sanyog.

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

Post by Yeray » Mon Feb 09, 2009 3:59 pm

Hi Sanyog,
drillright40 wrote:1.When we move the cursor tool outside the TChart boundary at one point it comes back to the middle of the Plot.Till certain extent it is not seen but after that it comes back to the middle of the Plot.
I haven't been able to reproduce it. In your project you are using two properties (StripAxis and Unit) that you may have been added to teechart source code. So we commented the lines where those properties are used.

Please, try to do an example we can reproduce as-is here using the "standard" teechart dll.
drillright40 wrote:2.One more line is seen on the left side of the Histogram in some scenarios.I have attached a file "CursorTool3.bmp".Please view it for your reference.
We could reproduce it in your application. We are investigating what could be the cause of that strange line.
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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor tool Query

Post by drillright40 » Tue Feb 10, 2009 4:27 am

Hi,

1.I have uploaded code "CursorToolQuery.zip".In this code i have commented the "stripAxis" and "Unit".Still i am able to reproduce the bug related to cursor tool coming to middle after it reaches some extent.This happens very often when there is huge data plotted in the histogram so i have added more number of points.To reproduce this u need to repeat the procedure atleast 3-4 times.It does not happen everytime.


2.Related to Cursor Tool Change event getting called many number of times.I have included the code to demostrate it. After the Histogram is plotted when user tries to change the position of the cursor tool using mouse , you can see the list box for the count of Cursor tool being invoked. I am not able to understand how to avoid this.

Whereas if the Cursor tool position is changed using code.i.e if u click on the button "Change Postion of Cursor tool", the cursor tool change event is called only once.I will need the similar functionality when user drags the cursor tool.

Please suggest.


Thanks
Sanyog.

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

Post by Sandra » Tue Feb 10, 2009 9:30 am

Hi Sayong,

1.I have uploaded code "CursorToolQuery.zip".In this code i have commented the "stripAxis" and "Unit".Still i am able to reproduce the bug related to cursor tool coming to middle after it reaches some extent.This happens very often when there is huge data plotted in the histogram so i have added more number of points.To reproduce this u need to repeat the procedure atleast 3-4 times.It does not happen everytime.
.

We haven't been able to reproduce this issue, because we don't know that we make.Could you please explain the following message as we can exactly reproduce the problem in your code?.
2.Related to Cursor Tool Change event getting called many number of times.I have included the code to demostrate it. After the Histogram is plotted when user tries to change the position of the cursor tool using mouse , you can see the list box for the count of Cursor tool being invoked. I am not able to understand how to avoid this.

I could reproduce your problem and recommend you change the following event:

Code: Select all

  private void cursorToolMinClipping_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
  {
            listBox1.Items.Add("Cursor Tool Invoked");

           
  }
For this event:

Code: Select all

        private void clipHistogramTChart_MouseUp(object sender, MouseEventArgs e)
        {
            if (cursorToolClipping.Clicked(e.X, e.Y) != Steema.TeeChart.Tools.CursorClicked.None)
            {
                listBox1.Items.Add("Cursor Tool Invoked");

            }
        }


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

drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Cursor Tool Query

Post by drillright40 » Fri Feb 13, 2009 1:08 pm

Hi,

I have uploaded the code for cursor tool.I am trying to explain the same problem again.Please check if you can reproduce it.

Only thing you need to do to reproduce this error is right click on the histogram and drag the histogram to the left till the cursor tool is moved out of the plot.Let the cursor tool cross the boundaries of the Chart.When it crosses the boundaries it comes back to the middle position again.

Repeat it many number of times to reproduce it.

Also the other problem reported to you regarding the strange line is resolved with the recent TChart.dll.I have put the TChart.dll in the bin\debug folder.


Please suggest.

Code uploaded : CursorToolQuery.zip Content Type application/zip Length 1329116

Thanks
Snayog Jain.

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

Post by Sandra » Mon Feb 16, 2009 10:12 am

Hi drillright40,



I could reproduce your problem and I have added to the list of Bug Report with number [TF02013864] we will try to fix it for next versions of TeeChart .NET.

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