SilverLight : Show date axis value in annotation

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Priya Hatipkar
Newbie
Newbie
Posts: 46
Joined: Wed Jan 28, 2009 12:00 am

SilverLight : Show date axis value in annotation

Post by Priya Hatipkar » Fri Jul 24, 2009 7:08 am

hi,
I am plotting datetime(time of bid) = x axis , against bid price in Y axis .
when the user moves the cursor i want to show the value of x,y in a annotation that follows the cursor , i managed to get the annotation to follow the cursor as seen in the attached jpg . but am not able to see the correct value of date X axis in annotation , it shows up as double instead of date . is there some calculate function to calc the date from that double value .

sample code
----------------------------
anon.Left = e.x;
anon.Top = e.y ;
anon.Width = 200;
anon.Height = 30;
anon.Text = "X=" + DemoChart.Axes.Bottom.SomeCalcXPosValuefunction(e.XValue or e.x).ToString() + "; Y=" + e.YValue.ToString("#.000");
Attachments
FxSample.JPG
FxSample.JPG (19.17 KiB) Viewed 8452 times

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

Re: SilverLight : Show date axis value in annotation

Post by Narcís » Fri Jul 24, 2009 1:03 pm

Hi Priya,

Yes, you can use FromOADate method:

Code: Select all

			DateTime dt = DateTime.FromOADate(x);
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

Priya Hatipkar
Newbie
Newbie
Posts: 46
Joined: Wed Jan 28, 2009 12:00 am

Re: SilverLight : Show date axis value in annotation

Post by Priya Hatipkar » Mon Jul 27, 2009 6:43 am

Thanks Narcis , works fine .

Post Reply