T O P I C R E V I E W |
kitmax |
Posted - 18 Mar 2010 : 09:04:42 I have some sample data in SQL which i'm able to query into sub groups and add to an xbar r graph, however, if i try to add the time i keep getting the following error. Unable to cast object of type 'System.DateTime' to type 'com.quinncurtis.chart2dnet.ChartCalendar' I've tried all different types but having no success, the date is a datetime object in sql that i'm pulling.
any ideas?
thanks |
2 L A T E S T R E P L I E S (Newest First) |
kitmax |
Posted - 18 Mar 2010 : 11:03:48 got it, thank you so much |
quinncurtis |
Posted - 18 Mar 2010 : 09:54:05 The time values for the AddNewSampleRecord method are ChartCalendar types. We use the ChartCalendar class because it contains extensive time/date arithmetic methods we use in calculations. So that is the type you must use. So convert your DateTime values to ChartCalendar values. This is trivial because the ChartCalendar class has a constructor which takes a DateTime value as an input parameter.
DateTime dt = GetSampleDateTimeValue();
// Convert the DateTime value to a ChartCalendar value, and call the AddNewSampleRecord method
this.ChartData.AddNewSampleRecord(new ChartCalendar(dt), samples);
|
|
|