Page 1 of 1

SilverLight : Show date axis value in annotation

Posted: Fri Jul 24, 2009 7:08 am
by 13051589
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");

Re: SilverLight : Show date axis value in annotation

Posted: Fri Jul 24, 2009 1:03 pm
by narcis
Hi Priya,

Yes, you can use FromOADate method:

Code: Select all

			DateTime dt = DateTime.FromOADate(x);

Re: SilverLight : Show date axis value in annotation

Posted: Mon Jul 27, 2009 6:43 am
by 13051589
Thanks Narcis , works fine .