Hello,
I'm trying to draw a colored line at a specific point on the x-axis of my chart using the colorline tool. The x-axis is date and time, which is giving me problems. I think this should work..
Line 82: colorLine1.Axis = WebChart1.Chart.Axes.Bottom
Line 83: colorLine1.Pen.Color = Drawing.Color.Yellow
Line 84: colorLine1.Value = "8/21/2007 11:14:00 AM"
Line 85:
But I get the following error..
Exception Details: System.FormatException: Input string was not in a correct format.
Can you tell me what I'm doing wrong?
cheers, Paul
using datetime with colorline tool
-
- Newbie
- Posts: 24
- Joined: Wed Feb 22, 2006 12:00 am
- Location: Flagstaff, Arizona, USA
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi LordWhorfin,
You should use something like this:
You should use something like this:
Code: Select all
colorLine1.Value = DateTime.Parse("8/21/2007 11:14:00 AM");
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 24
- Joined: Wed Feb 22, 2006 12:00 am
- Location: Flagstaff, Arizona, USA
That generates an error..narcis wrote:Hi LordWhorfin,
You should use something like this:
Code: Select all
colorLine1.Value = DateTime.Parse("8/21/2007 11:14:00 AM");
Conversion from 'Date' to 'Double' requires calling the 'Date.YoOADate' method.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
HI LordWhorfin,
Sorry, what about this then?
Sorry, what about this then?
Code: Select all
colorLine1.Value = DateTime.Parse("8/21/2007 11:14:00 AM").ToOADate();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 24
- Joined: Wed Feb 22, 2006 12:00 am
- Location: Flagstaff, Arizona, USA
That did it, thank you. Paulnarcis wrote:HI LordWhorfin,
Sorry, what about this then?
Code: Select all
colorLine1.Value = DateTime.Parse("8/21/2007 11:14:00 AM").ToOADate();