Page 1 of 1

Points3D with DateTime on bottom horiz axis

Posted: Thu Nov 04, 2010 2:49 pm
by 13049469
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

Re: Points3D with DateTime on bottom horiz axis

Posted: Thu Nov 04, 2010 3:00 pm
by narcis
Hi Scott,

Yes, you forgot this:

Code: Select all

            p3d.XValues.DateTime = true;
For further axis settings please read tutorial 4 available at TeeChart's program group.