Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 381 - [TF02013505] I would like to add a tooltip to the bottom axis labels so that if th...
Summary: [TF02013505] I would like to add a tooltip to the bottom axis labels so that ...
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Axes (show other bugs)
Version: unspecified
Hardware: All All
: Normal major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-30 12:09 EDT by narcís calvet
Modified: 2013-12-02 11:39 EST (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description narcís calvet 2013-11-20 11:26:39 EST
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.
[img]http://picasaweb.google.com/ryan.hardoon/TChartIssues#5262481354581063314[/img]

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.
It calculates Clicked method as if Labels.Angle was set to zero, code to reproduce:
public Form1()
 {
 InitializeComponent();
 InitializeChart();
 }

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

 tChart1.Legend.Visible = false;
 tChart1.Axes.Bottom.Labels.Angle = 90;

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

 Random y = new Random();
 for (int i = 0; i < 10; i++)
 {
 bar1.Add(y.Next(),"Quite a long axis label #" + (i+1).ToString());
 }

 tChart1.GetAxisLabel += new Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
 tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);

 tChart1.Draw();
 }

 void tChart1_MouseMove(object sender, MouseEventArgs e)
 {
 int index = tChart1.Axes.Bottom.Labels.Clicked(e.X, e.Y);

 this.Text = index.ToString();
 }

 void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
 {
 if (((Steema.TeeChart.Axis)sender).Equals(tChart1.Axes.Bottom))
 {
 if (e.LabelText.Length > 15)
 {
 e.LabelText = string.Format("{0}{1}", e.LabelText.Substring(0, 15), "...");
 }
 }
 } [created:2008-10-30T12:09:58.000+01:00 reported by:narcis@steema.com reported in version:Build 3.5.3146.24804 (TeeChart for .NET)]
Comment 1 christopher ireland 2013-12-02 11:39:42 EST
Axis labels now correctly respond to clicks when Angle>0.