Problems drawing labels near CursorTool after Removing axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
rf2005
Newbie
Newbie
Posts: 11
Joined: Fri Jul 28, 2006 12:00 am

Problems drawing labels near CursorTool after Removing axes

Post by rf2005 » Wed Jan 09, 2008 1:15 pm

Hello,

I added some Labels to my chart's CursorTool. This Labels are located directly left (or right) of the CursorTool. To determine the right X-Position for my Labels I use the following code:

Code: Select all

int xPixel = this.Chart.Axes.Custom[0].CalcXPosValue(XValue);
this.getTopLabel().Location = new System.Drawing.Point(xPixel, 30);
This works fine.

BUT:

I use some vertical custom axes at the left side of the chart. There is one axis for every ChartLine. If one ChartLine will be removed, the corresponding vertical axis will be removed too. Left margin of the Chart will be set new to use the space, the removed axis left behind. Afterwards, the value in xPixel (using above shown code) is not correct anymore. Labels are not shown nearby the CursorTool but about 10 Pixels away from the cursor. What can I do to avoid this problem?

Thank you in advance,

rf

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

Post by Narcís » Wed Jan 09, 2008 2:09 pm

Hi rf,

You'd better use this code in TChart's AfterDraw event so that those variables/properties are reevaluated every time the chart is being drawn.
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