Chart.Axes.Bottom.Labels.Clicked problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Chart.Axes.Bottom.Labels.Clicked problem

Post by qcrnd » Wed Oct 29, 2008 8:02 am

Hi
I would like to add a tooltip to the bottom axis labels so that if the mouse is above a label I will present some data. The labels are vertical.
Image

I did a test with a graph with 25 labels on the x axis , using the Chart.Axes.Bottom.Labels.Clicked to check which label the mouse is on.
I found several problems
1. it returns a valid index only when the mouse is on part of the label . on other parts of the label it returns -1.
2. it returns wrong indexes. the indexes seem to be from top to bottom ..e the first label on the left returns 21, the second is 20 the third is 19 etc. instead of 0, 1 ,2 . The last 3 return -1. Also sometimes I get a vaild index inbetween labels and -1 on the label itself

In short it doesnt seem that the Clicked is accurate or maybe there is a different way to test the labels.

I also tested it on other graphs with less labels and I see the same inacurracy problem .

Please Help
Thanks
Ryan.[/img]

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

Post by Narcís » Thu Oct 30, 2008 11:13 am

Hi Ryan,
1. it returns a valid index only when the mouse is on part of the label . on other parts of the label it returns -1.
This is a bug, it calculates Clicked method as if Labels.Angle was set to zero. I've added this (TF02013505) to the bug list to be fixed.
2. it returns wrong indexes. the indexes seem to be from top to bottom ..e the first label on the left returns 21, the second is 20 the third is 19 etc. instead of 0, 1 ,2 . The last 3 return -1. Also sometimes I get a vaild index inbetween labels and -1 on the label itself
There are two thinks here:

a) Labels are drawn downwards therefore right-most lables have lower indexes and viceversa. IIRC this is by design.
b) Bug in question 1 makes this worse as only a subset of all points labels are displayed.
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

Post Reply