HighSpeedCharting简单的使用
生活随笔
收集整理的這篇文章主要介紹了
HighSpeedCharting简单的使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
HighSpeedCharting動態繪圖點擊下載動態繪圖
一、創建工程
第一步:將ChartCtrl放入工程文件夾之中,并導入ChartCtrl文件夾 點擊下載
第二步:添加控件:custom Control
第三步:修改屬性
第四步:添加變量
二、簡單的使用
1、? 創建坐標軸:
CChartAxis *pAxis = NULL; pAxis= m_ChartCtrl.CreateStandardAxis(CChartCtrl::BottomAxis); pAxis->SetAutomatic(false); //不自適應 pAxis= m_ChartCtrl.CreateStandardAxis(CChartCtrl::LeftAxis); pAxis->SetAutomatic(true); //自適應TChartString str1; str1=_T("LineChart"); m_ChartCtrl.GetTitle()->AddString(str1); //設置標題str1 =_T("num"); pAxis= m_BarChart.GetLeftAxis(); // pAxis->SetMinMax(0.1,70); if (pAxis)pLabel= pAxis->GetLabel(); if (pLabel)pLabel->SetText(str1);str1=_T("數值坐標軸"); pAxis= m_BarChart.GetBottomAxis(); if (pAxis)pLabel= pAxis->GetLabel(); if (pLabel)pLabel->SetText(str1); pAxis->SetMinMax(0,BARMAX);2、? 畫圖:
m_ChartCtrl.EnableRefresh(false); CChartLineSerie *pLineSerie; m_ChartCtrl.RemoveAllSeries();//先清空 pLineSerie =m_ChartCtrl.CreateLineSerie(); pLineSerie->AddPoint(x[i], y[i]); //添加數值 m_ChartCtrl.EnableRefresh(true);3、 保存圖片:
TChartString fileName; CRect crect; crect.SetRect(0,0, 700, 400); //set the size of the image m_ChartCtrl.SaveAsImage(_T(".\\lineChart.png"),crect,32,GUID_NULL); //savethe image總結
以上是生活随笔為你收集整理的HighSpeedCharting简单的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MFC绘图工具High-speed Ch
- 下一篇: tradingview教程 charti