Home > Software engineering >  Help: VC6.0 MFC High -speed charting controls dynamic curve abscissa setting
Help: VC6.0 MFC High -speed charting controls dynamic curve abscissa setting

Time:11-07

Below is I placed on MFC interface, a High - Speed charting drawing controls, used to display serial upload data, dynamic update 1 seconds 5 points, this drawing control can display 500 points at a time, now the abscissa setting is displayed automatically, when the effect of data update is the waveform in the move to the left, and the abscissa is every 100 points according to coordinate values at a time, I hope the effect of every once in a while (such as 10 seconds) shows the horizontal coordinate values, in the process of data updating abscissa in 10 seconds, 20 seconds, 30 seconds... Place to display, and display is 10, 30, or directly display the current time, accurate to seconds, could you tell me how to achieve this?

CodePudding user response:

This, as far as I know, if just using the built-in function in the control, seems to reach the purpose of your said,
May need to change the High speed charting the source code, if you say you don't need the scroll bar is the function of functions, such as advice or write a template reference chicken peck rice tutorial cpen line drawing,

CodePudding user response:

The original poster can come to a source? I used vc + + to add this control has been failure, mailboxes, genuflect is begged 1463431379 @qq.com

CodePudding user response:

Refer to the https://blog.csdn.net/czyt1988/article/details/8740500

CodePudding user response:

Can consider to change the source code ChartAxis. CPP DrawTick in function, the content of
If (m_bIsHorizontal)
{
If (TickPos M_EndPos)
BTickOnAxis=false;
if (! M_bIsSecondary)
{
If (bTickOnAxis)
{
PDC - & gt; MoveTo (TickPos, m_AxisRect. Top + 1);
PDC - & gt; LineTo (TickPos, m_AxisRect. Top + 4);
}
If (bLabelOnAxis)
{
//I change the content of the reference
TChartString TMP=_T (" ");
Int allsize=m_pXAxisName. The size ();
If (dTickVal & lt; Allsize)
{
TMP=m_pXAxisName [dTickVal];
//m_pindex + +;
PDC - & gt; ExtTextOut (lLabelPos - TextSize. Cx/2-15, m_AxisRect. Top + 5,
ETO_CLIPPED | ETO_OPAQUE, NULL, TMP. C_str (), NULL);
}
}
}
The else
{
If (bTickOnAxis)
{
PDC - & gt; MoveTo (TickPos, m_AxisRect. Bottom - 1);
PDC - & gt; LineTo (TickPos, m_AxisRect. Bottom - 4);
}
If (bLabelOnAxis)
{
PDC - & gt; ExtTextOut (lLabelPos - TextSize. Cx/2, m_AxisRect. The bottom - 5 - TextSize. Cy,
ETO_CLIPPED | ETO_OPAQUE, NULL, strBuffer c_str (), NULL);
}
}
}
  • Related