jamescway
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jamescway
-
-
I have a DataTable with a Time column. What format or type should I make this column?
I tried playing with using the DateTime type which does work, but the date is stored as well in the form of (1/1/1001 hh:mm:ss) which I don't want, just the time.
I saw that there was a an AxisFormat.Time and AxisFormat.DateTime. What is the difference between these two types and how do you use the AxisFormat.Time with a datasource? I tried to find the answer on the forums, but was unable to.
I also tried to create the column as a DateTime, and pass the time using ToOATime(). On the chart I set it up this way:
_chartCtrl.AxisX.LabelsFormat.Format = AxisFormat.Time;
_chartCtrl.AxisX.LabelsFormat.CustomFormat = "mm:ss";
But instead of showing mm:ss it doesn't seem to recognize the passed value and just prints out the double value of the OATime.
Thanks,
James
What is the type of AxisFormat.Time?
in Windows Forms
Posted
Thanks for the reply Rogelio!
This is actually very similar to the method that I ended up figuring out except I am using a datasource for the chart (DataTable). I was forced to make one of the columns a DateTime which works fine using the custom format "hh:mm:ss". The problem is that when I save this datatable it saves the entire date time 2009-03-04T00:00:00-08:00 when all I really need is just the time. I was hoping I could pass just a string or something instead that AxisFormat.Time will be able to understand, but I wasn't able to figure that out.
Maybe I can use some type of xmlwriter function to save it, but I haven't figured out how to do that either.