Page 1 of 1

Chart.Axes.Bottom.Labels.Clicked problem

Posted: Wed Oct 29, 2008 8:02 am
by 9092401
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]

Posted: Thu Oct 30, 2008 11:13 am
by narcis
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.