How to plot line chart with Real-time data at Dialog-base application?
2018-03-22 17:26
525 查看
How to plot line chart with Real-time data at Dialog-base application?
Visual Studio Languages , Windows Desktop Development > Visual C++Question
0Sign in to voteHi, Sir:I would like to create MFC Dialog-base application for ploting realtime dataI found many free sample code from website, like "Draw or display Real-time data plot Chart"
,"Simple Real-time Class for Advanced Charts and Plotting", it is good for ploting.But they are all base Doc/View, not Dialog-baseI download source code from "Draw or display Real-time data plot Chart"
But it is fail to run "Create" functionHow to modify code to match my necessary?((CButton *)GetDlgItem(IDC_CHART_REALTIME))->GetClientRect(&clientRect); // IDC_CHART_REALTIME is Picture Control
m_Plot.Create(WS_VISIBLE, clientRect, this, 12000, TRUE);BOOL clPlot::Create(DWORD dwstyle, CRect &rect, CWnd *pParent, UINT id)
{
DWORD style = dwstyle & (~WS_BORDER);
if(dwstyle & WS_BORDER)
m_bctlBorder=TRUE;
else
m_bctlBorder=FALSE; if (!CWnd::Create(NULL, "", style, rect, pParent, id, NULL))
return FALSE;
m_ctlRect = rect;
pParent->ClientToScreen(m_ctlRect);
ScreenToClient(m_ctlRect); ComputeRects(TRUE);
return TRUE;
}void clPlot::ComputeRects(BOOL bInitialization)
{
CClientDC dc(this);
...
}void clPlot::OnPaint()
{
CPaintDC dc(this); // device context for painting
...
}
void clPlot::MoveWindow(CRect & Rect)
{
m_ctlRect = Rect;
GetParent()->ClientToScreen(m_ctlRect);
ScreenToClient(m_ctlRect);
ComputeRects(TRUE);
CWnd::MoveWindow(Rect);
}
ps:
Simple Real-time Class for Advanced Charts and Plotting:
http://www.codeguru.com/cpp/controls/controls/chartingandanaloguecontrols/article.php/c2223/Simple-Realtime-Class-for-Advanced-Charts-and-Plotting.htm
Draw or display Real-time data plot Chart:
http://www.ucancode.net/Visual_C_MFC_Samples/Draw_Display_Real_Time_data_Plot_Chart_vc_example.htmThanks!!!BR,
AlanThursday, June 04, 2015 1:56 AMReply|Quotealan.emc0 Points
Answers
0Sign in to voteHi alan.emc,I have downloaded that sample - Draw or display Real-time data plot Chart. And it works well after I resolved some dependency issue.So What do you mean it is fail on "create" function? Does the function didn't get invoked or one line code in that function fails? What error message do you get?Please explain more details.I try to make the real- time data plot chart display on a dialog, so I create a MFC dialog based project. Copy the code in demoview.cpp to my dialog class cpp file(add clPlot m_Plot, OnTimer, Onsize OnEraseBkgnd) , and add refencence to clPlot project. check this screenshot:
Hope this helps some.ShuWe are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Edited by Shu 2017 Friday, June 05, 2015 6:03 AM
Marked as answer by Shu 2017 Tuesday, June 16, 2015 12:12 PM
Friday, June 05, 2015 3:37 AMReply|QuoteShu 2017NO11,415 Points
All replies
0Sign in to voteHi alan.emc,I have downloaded that sample - Draw or display Real-time data plot Chart. And it works well after I resolved some dependency issue.So What do you mean it is fail on "create" function? Does the function didn't get invoked or one line code in that function fails? What error message do you get?Please explain more details.I try to make the real- time data plot chart display on a dialog, so I create a MFC dialog based project. Copy the code in demoview.cpp to my dialog class cpp file(add clPlot m_Plot, OnTimer, Onsize OnEraseBkgnd) , and add refencence to clPlot project. check this screenshot:
Hope this helps some.ShuWe are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Edited by Shu 2017 Friday, June 05, 2015 6:03 AM
Marked as answer by Shu 2017 Tuesday, June 16, 2015 12:12 PM
Friday, June 05, 2015 3:37 AMReply|QuoteShu 2017NO11,415 Points
0Sign in to voteI have same issue when built in release mode. May I know what you change to make it run in release mode? Thanks
转:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/06a9cea8-db05-4319-b201-1e3896c4a408/how-to-plot-line-chart-with-realtime-data-at-dialogbase-application?forum=vcgeneral
相关文章推荐
- How to call webservices with ASP.NET at Run time?
- How to load a dll resource dialog box at an application Dialog box (怎么在一个应用程序对话框动态加载DLL里的资源对话框)
- How to read out WhatsApp messages with Tasker and react on their content in real time
- HOWTO: Include Base-64 Encoded Binary Image Data (data URI scheme) in Inline Cascading Style Sheets (CSS)(转)
- How to monitor Nginx web server from the command line in real time
- How to get Login Passwords for application & Data Base instances
- how to create a window ot dialog with fixed size?
- How to Use 'Exec Sp_executesql' to Read SQL String with Data Exchange(Interface)
- Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
- How to Sync Your Linux Server Time with Network Time Servers (NTP)
- [React] Pass Data To Event Handlers with Partial Function Application
- How to Deal with Messy Codes in Essbase
- How to Recover from a Lost or Deleted Datafile with Different Scenarios [ID 198640.1]
- Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- MPAndroidChart 教程:动态和实时数据 Dynamic & Realtime Data(八)
- How to Access Stock Quotes Realtime through Google Finance
- How to debug c++ console application with argument in visual studio 2012
- How to implement realtime periodic tasks in Linux applications
- 错误提示:Multiple annotations found at this line: basePath cannot be resolved to a variable