ColorGrid - Clicked() function returns -1

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

ColorGrid - Clicked() function returns -1

Post by Dave » Wed Jan 06, 2010 2:56 pm

Hi Support

Im using a Contour as the DataSource to a ColorGrid

On a mouse click I get the index to the underlying series doing this.

Point p = myColorGrid.ValuePointToScreenPoint(myCursor.XValue, myCursor.YValue);
int index = myColorGrid.Clicked(p);

As long as index >= 0 then everything is fine and I can access the series data.

However when I click at the very top (maximumm y axis extent) of the colorgrid (lets say y = 100)) index is returning -1.
I know the data for y=100 is there because the Steema Editor shows the Series data. So why cant I get a valid index returned.
Everything works fine for a mouse-click for y < 100 just not for y = 100. Its as though y=100 is not being displayed on the chart when I think it is.

Any ideas whats going wrong?

Thanks

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

Re: ColorGrid - Clicked() function returns -1

Post by Narcís » Thu Jan 07, 2010 2:45 pm

Hi Dave,

First of all please notice that such series need to be populated as I described here. Having said that, when IrregularGrid=false, ColorGrid series is painted as a typical grid, one column and row for each X and Z values, as an Excel grid would be. When IrregularGrid=true one column and row are suppressed to be able to plot a grid-like structure. Is that your case?

If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here and let us know the TeeChart version you are using.

Thanks in advance.
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

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: ColorGrid - Clicked() function returns -1

Post by Dave » Fri Jan 08, 2010 10:47 am

Hi Narcis

Thanks. I think its making sense now. When I click the top of the colorgrid (at the maxm Y [or should that be Z!] extent on the chart) Im not clicking on a grid cell as such. Im just clicking on a point. There is no grid cell associated with my mouse click because Im at the top of the chart. I suppose the way round this is to increase the Y-extent of the chart but I dont want to do this. Im not sure if there is an easy solution.

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

Re: ColorGrid - Clicked() function returns -1

Post by Yeray » Mon Jan 11, 2010 9:00 am

Hi Dave,

Please, try to arrange a simple example project we can run as-is, explaining the steps we should follow if necessary, to reproduce the problem here. This would help us to understand the exact situation.

Thanks in advance.
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

Post Reply