Home > Software engineering >  PlotY CWgraph control functions and ChartY
PlotY CWgraph control functions and ChartY

Time:10-03

When using this control to select PlotY function, the timing of the mining can a point a point, but the abscissa motionless, will function in as ChartY function, the abscissa can update, I set the maximum value to 150, for example, when curve in 150 will continue to show from the very beginning, the abscissa shows that from 150 to 300, but also show several points, composed of several section of straight line, and shows more and more, but the great spirit to guide how to use ChartY function one by one point show
Int m_CurPos=0;
int count=0;
BOOL m_bXuanhuan=FALSE;
Float TempData=https://bbs.csdn.net/topics/20;
# define CURVEPOINT 100
Float data [100] [CURVEPOINT];
Void CGraphIOView: : the OnInitialUpdate ()
{
CFormView: : OnInitialUpdate ();
GetParentFrame () - & gt; RecalcLayout ();
ResizeParentToFit ();
For (int I=0; i<100; I++)
{
For (int j=0; j<100; J++)
{
M_fEngData [I]=0.0;
}
}
//ReadData ();
The SetTimer (1200, NULL);
Void CGraphIOView: : ShowCurve ()
{
int i=0;//I value is to show parameter curve number
CNiReal64Vector vect1 (CURVEPOINT);
//for (int I=0; i<100; I++)
{
Data [I] [m_CurPos]=m_fEngData [I];
}

//data [0] [m_CurPos]=m_fEngData [0].
If (m_bXuanhuan)
{
Int k=0;
For (int I=m_CurPos; i{
Vect1 [k]=data [0] [I];
}
For (I=0; i{
Vect1 [k]=data [0] [I];
}
}
The else
{
Vect1. SetSize (m_CurPos + 1);
For (int I=0; i{
Vect1 [I]=data [0] [I];
}
}
M_Graph. GetPlots (). The Item (1) ChartY (vect1, 1);
M_CurPos + +;
If (m_CurPos & gt; CURVEPOINT)
{
M_bXuanhuan=TRUE;
M_CurPos=0;
}
}

Void CGraphIOView: : OnTimer (UINT nIDEvent)
{
//TODO: Add your message handler code here and/or call the default
//if (count<100)
{
//GenericData (count);
}
GenericData ();//create a random number
ShowCurve ();//generated curve
CFormView: : OnTimer (nIDEvent);
}

Void CGraphIOView: : GenericData ()
{
int i=0;
//for (I=0; i<100; I++)
{
M_fEngData [I]=rand ()/1000 + 10;
}
}
}

CodePudding user response:

Since the drawing is to learn the skills in the morning and evening,
  • Related