I'm filling a XYDataSeries with the double values that contain DateTimes from a DataTable. After reading the previous post on time question, I've converted the DateTime to OADate. No matter what I've tried, the X item names come out as numbers like "39544".
Here is a snippet of some test code:
XYDataSeries xyds = new XYDataSeries();
Double[] X = new Double[custCount];
String[] Y = new String[custCount];
int i = 0;
foreach (DataRow row in dt.Rows)
{
X[i] = (Convert.ToDateTime(row["MIN"].ToString())).ToOADate();
Y[i] = (i*i).ToString();
i++;
}
xyds.Label = "Test Series";
xyds.XValuesSource = X;
xyds.ValuesSource = Y;
c1Chart1.Data.Children.Clear();
c1Chart1.Data.Children.Add(xyds);
This is such a basic and typical thing to do, it is frustrating to find nothing on it! Besides the Date question, any advice on filling a WPF chart from a DateSet or DateTable would be greatly appreciated!