Points3D with DateTime on bottom horiz axis
Posted: Thu Nov 04, 2010 2:49 pm
I'm having a problem with setting on of the axes of my chart to a DateTime format. Here is a code snippet:
public Form1()
{
InitializeComponent();
tChart1.Series.Clear();
// Test data
double[] yData = new double[10];
double[] zData = new double[10];
DateTime[] xData = new DateTime[10];
for (int index = 0; index < 10; index++)
{
TimeSpan ts = new TimeSpan(index, 0, 0, 0);
xData[index] = DateTime.Now + ts;
yData[index] = index;
zData[index] = 20 * Math.Sin(index * Math.PI / 5);
}
Points3D p3d = new Points3D();
p3d.Add(xData, zData, yData);
tChart1.Series.Add(p3d);
}
I feel like I've left out a step. Any ideas?
Best regards,
Scott
public Form1()
{
InitializeComponent();
tChart1.Series.Clear();
// Test data
double[] yData = new double[10];
double[] zData = new double[10];
DateTime[] xData = new DateTime[10];
for (int index = 0; index < 10; index++)
{
TimeSpan ts = new TimeSpan(index, 0, 0, 0);
xData[index] = DateTime.Now + ts;
yData[index] = index;
zData[index] = 20 * Math.Sin(index * Math.PI / 5);
}
Points3D p3d = new Points3D();
p3d.Add(xData, zData, yData);
tChart1.Series.Add(p3d);
}
I feel like I've left out a step. Any ideas?
Best regards,
Scott