VS2010高速绘图Hight-Speed Charting -- 函数说明
控件使用教程:https://blog.csdn.net/zang141588761/article/details/50536811
控件下載網址:https://www.codeproject.com/Articles/14075/High-speed-Charting-Control
一些函數說明:控件變量 ? CChartCtrl ?m_ChartCtrl;
添加標題:
m_ChartCtrl.SetBackColor(RGB(255,0,0)); m_ChartCtrl.GetTitle()->AddString(t_ChartCtrl1); //m_ChartCtrl.GetTitle返回標題對象 m_ChartCtrl.GetTitle()->SetColor(RGB(255,0,0)); //標題設為紅色 m_ChartCtrl.GetTitle()->RemoveAll(); //清除標題 int num = m_ChartCtrl.GetTitle()->GetStringCount(); //標題行數 m_ChartCtrl.GetTitle()->SetVisible(false); //設置標題不可見,變量bool型 m_ChartCtrl.GetTitle()->IsVisible(); //標題可見 //顏色的類 COLORREF 類 COLOREEF color; /*//! Returns the background colorCOLORREF GetBackColor() const { return m_BackColor; }//! Sets the background color.void SetBackColor(COLORREF NewCol) { m_BackColor = NewCol; m_bBackGradient = false; RefreshCtrl();}//! Returns the color of the plotting area's border COLORREF GetBorderColor() const { return m_BorderColor;}*/高速繪圖控件坐標軸以及坐標標簽
?? ?CChartAxis* pAxis1;pAxis1 = m_ChartCtrl.CreateStandardAxis(CChartCtrl::BottomAxis); //底部pAxis1->SetAutomatic(true);pAxis1 = m_ChartCtrl.CreateStandardAxis(CChartCtrl::LeftAxis); //左側pAxis1->SetAutomatic(true); //控件坐標標簽pAxis1 = NULL; //對象為空CChartAxisLabel* pLabel = NULL;TChartString t_label1 = _T("數值型坐標軸");pAxis1 = m_ChartCtrl.GetBottomAxis(); //獲得底部坐標軸if (pAxis1){pLabel = pAxis1->GetLabel();}if (pLabel){pLabel->SetText(t_label1);} //其他的坐標軸,使用方法同上 /* CChartAxis* GetBottomAxis() const; CChartAxis* GetLeftAxis() const; CChartAxis* GetTopAxis() const; CChartAxis* GetRightAxis() const; */高速繪圖控件背景顏色設置
//設置控件背景顏色 m_ChartCtrl.SetBackColor(RGB(255,0,0)); //返回顏色RGB值 color = m_ChartCtrl.GetBackColor(); int nR = GetRValue(color); int nG = GetRValue(color); int nB = GetRValue(color);圖形的縮放功能
//CChartCtrl :: SetZoomEnabled(bool bEnabled)m_ChartCtrl.SetZoomEnabled(false);//CChartAxis :: SetZoomLimit(double dLimit) 坐標軸的縮放限定void SetZoomLimit(double dLimit) { m_dZoomLimit = dLimit; }平移,鼠標下的點將跟隨鼠標移動,實際軸的最大值和最小值將改變,默認是開啟。
//CChartCtrl::SetPanEnabled(bool bEnabled) m_ChartCtrl.SetPanEnabled(false);EnableRefresh()這個函數主要是用于將改變顯示到控件圖形中,在需要對某個值進行修改時必須先執行EnableRefresh(false);再執行EnableRefresh(true);
CChartCtrlSerieBase::SetSeriesOrdering
//virtual void SetSeriesOrdering(PointsOrdering newOrdering);CChartLineSerie* pLineSerie; //創建對象m_ChartCtrl.RemoveAllSeries(); //清除所有線pLineSerie = m_ChartCtrl.CreateLineSerie();pLineSerie->SetSeriesOrdering(poNoOrdering); //設置為無序?
該系列的一個重要特征是控制點的順序:該系列中的所有點將根據它們的值重新排序。 默認情況下,點是基于它們的X值排序的,但您可以通過對它們的Y值排序或不對它們進行排序來改變這種行為(在這種情況下,系列保持將點添加到系列中的順序 )。 對點進行排序會對性能產生影響:如果點是有序的,則控件能夠從完整系列中檢索第一個和最后一個可見點,并且僅繪制兩個點之間的點。 另一方面,你將不能繪制像橢圓形的曲線。 您可以通過調用CChartSerieBase :: SetSeriesOrdering來更改點的順序。
持續更新
總結
以上是生活随笔為你收集整理的VS2010高速绘图Hight-Speed Charting -- 函数说明的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Dojo Charting 控件高级用法
- 下一篇: MFC之图像绘制---高速绘图控件(Hi