Use CalcXPosValue on Datetime axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
malkarra
Newbie
Newbie
Posts: 6
Joined: Mon Feb 20, 2006 12:00 am

Use CalcXPosValue on Datetime axes

Post by malkarra » Wed Apr 12, 2006 8:39 pm

I would like to output a text at location defineded by x which is a datetime and the bottom axes isdatetime.
How can I get that location?
CalcXPosValue accepts double only.
Thanks in advance

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 Apr 13, 2006 8:22 am

Hi malkarra,

You can easily convert a DateTime value to a double using Microsoft .NET Framework's methods as shown here:

Code: Select all

    private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      int x = line1.CalcXPosValue(Convert.ToDouble(line1.XValues[5]));
      int y = line1.CalcYPosValue(line1.YValues[5]);
      tChart1.Graphics3D.TextOut(x,y,"My Text");
    }
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