ali rAZA

ali rAZA

  • NA
  • 1
  • 0

problem with MSCHART spline graph!

Apr 24 2010 7:37 AM

hi bloggers,
I have been trying to visualize my gestures through MS chart graph, for instance using wiimote accelerometer to draw a shape of the number(0-9), when I try to make 0,6,8,9  the shape is not drawn completely rather the coordinates get on the spreads on the other side.... currently Im calculating velocity and distance from the accelerometer values(x,y,z) and then plot distance values to MSCHART spline graph....
give me some suggestions or solutions how can I correct my code...
 
this is the snippet of the code which Im trying to plot on the graph
private void show()
{
 f
or (int i = 1; i < size; i++)
{
VX[i] = VX[i - 1] + (XA[i] * RecordTimer.Interval * 10.0);
VY[i] = VY[i - 1] + (YA[i] * RecordTimer.Interval * 10.0);
VZ[i] = VZ[i - 1] + (ZA[i] * RecordTimer.Interval * 10.0);
}
for (int i = 0; i < size; i++)
{
DX[i] = VX[i] * RecordTimer.Interval;//timer is 0.01 seconds
DY[i] = VY[i] * RecordTimer.Interval;
DZ[i] = VZ[i] * RecordTimer.Interval;
}
for (int i = 0; i < size - 1; i++)
{
DisX.Text +=
string.Format("{0:0.00000000}\n", Convert.ToInt32(DX[i]).ToString());
DisY.Text +=
string.Format("{0:0.00000000}\n", Convert.ToInt32(DY[i]).ToString());
DisZ.Text +=
string.Format("{0:0.00000000}\n", Convert.ToInt32(DZ[i]).ToString());
}

for (int i = 0; i <size - 1; i++)
{
double x = DX[i];
double y = DY[i];
double z = DZ[i];

CXZ.Series[
"XZ"].Points.AddXY(x, -z);
CXY.Series[
"XY"].Points.AddXY(x, -y);
CYZ.Series[
"YZ"].Points.AddXY(y,-z);
}

}

 
 
suggestions are anxiously welcomed.....