Page 1 of 1

Cursor Tool Query

Posted: Fri Feb 06, 2009 7:19 am
by 14047415
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]

Posted: Fri Feb 06, 2009 9:02 am
by 10050769
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?

Cursor tool Query

Posted: Fri Feb 06, 2009 10:54 am
by 14047415
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.

Posted: Fri Feb 06, 2009 12:10 pm
by narcis
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();
		}

Cursor tool Query

Posted: Mon Feb 09, 2009 5:28 am
by 14047415
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.

Posted: Mon Feb 09, 2009 9:02 am
by 10050769
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,

Cursor tool Query

Posted: Mon Feb 09, 2009 11:33 am
by 14047415
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.

Posted: Mon Feb 09, 2009 12:07 pm
by yeray
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.

Cursor tool Query

Posted: Mon Feb 09, 2009 1:18 pm
by 14047415
Hi,

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

Thanks
Sanyog.

Posted: Mon Feb 09, 2009 3:59 pm
by yeray
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.

Cursor tool Query

Posted: Tue Feb 10, 2009 4:27 am
by 14047415
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.

Posted: Tue Feb 10, 2009 9:30 am
by 10050769
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,

Cursor Tool Query

Posted: Fri Feb 13, 2009 1:08 pm
by 14047415
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.

Posted: Mon Feb 16, 2009 10:12 am
by 10050769
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,