当前位置: 首页>>代码示例>>C++>>正文


C++ CChartAxis::GetLabel方法代码示例

本文整理汇总了C++中CChartAxis::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CChartAxis::GetLabel方法的具体用法?C++ CChartAxis::GetLabel怎么用?C++ CChartAxis::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CChartAxis的用法示例。


在下文中一共展示了CChartAxis::GetLabel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnBnClickedTopaxisRadio

void CRegisterValueAnalyzerDlg::OnBnClickedTopaxisRadio()
{
	CChartAxis* pAxis = m_ChartCtrl.GetTopAxis();
	if (pAxis->IsVisible())
		((CButton*)GetDlgItem(IDC_AXISVISIBLE_CHECK))->SetCheck(1);
	else
		((CButton*)GetDlgItem(IDC_AXISVISIBLE_CHECK))->SetCheck(0);
	if (pAxis->GetGrid()->IsVisible())
		((CButton*)GetDlgItem(IDC_AXISGRIDVIS_CHECK))->SetCheck(1);
	else
		((CButton*)GetDlgItem(IDC_AXISGRIDVIS_CHECK))->SetCheck(0);
	if (pAxis->IsAutomatic())
		((CButton*)GetDlgItem(IDC_AXISAUTOMATIC_CHECK))->SetCheck(1);
	else
		((CButton*)GetDlgItem(IDC_AXISAUTOMATIC_CHECK))->SetCheck(0);
	if (pAxis->IsInverted())
		((CButton*)GetDlgItem(IDC_AXISINVERTED_CHECK))->SetCheck(1);
	else
		((CButton*)GetDlgItem(IDC_AXISINVERTED_CHECK))->SetCheck(0);
	if (pAxis->ScrollBarEnabled())
		((CButton*)GetDlgItem(IDC_AXISSCROLLBAR_CHECK))->SetCheck(1);
	else
		((CButton*)GetDlgItem(IDC_AXISSCROLLBAR_CHECK))->SetCheck(0);

	TChartString AxisLabel = pAxis->GetLabel()->GetText();
	GetDlgItem(IDC_AXISLABEL_EDIT)->SetWindowText(AxisLabel.c_str());

	double Min=0, Max=0;
	CString strBuff;
	pAxis->GetMinMax(Min,Max);
	strBuff.Format(_T("%.2f"),Min);
	GetDlgItem(IDC_AXISMINVAL_EDIT)->SetWindowText(strBuff);
	strBuff.Format(_T("%.2f"),Max);
	GetDlgItem(IDC_AXISMAXVAL_EDIT)->SetWindowText(strBuff);	
}
开发者ID:Fance,项目名称:T3000_Building_Automation_System,代码行数:35,代码来源:RegisterValueAnalyzerDlg.cpp

示例2: OnEnKillfocusAxislabelEdit

void CRegisterValueAnalyzerDlg::OnEnKillfocusAxislabelEdit()
{
	CChartAxis* pAxis = GetSelectedAxis();
	TCHAR szBuffer[255];
	GetDlgItem(IDC_AXISLABEL_EDIT)->GetWindowText(szBuffer,254);
	pAxis->GetLabel()->SetText(szBuffer);
	m_ChartCtrl.RefreshCtrl();	
}
开发者ID:Fance,项目名称:T3000_Building_Automation_System,代码行数:8,代码来源:RegisterValueAnalyzerDlg.cpp

示例3: OnInitDialog

BOOL CAntimonyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	m_brush.CreateSolidBrush(RGB(0, 122, 204));
	m_font.CreatePointFont(120, L"微软雅黑");
	m_font1.CreatePointFont(150, L"微软雅黑");
	m_font2.CreatePointFont(200, L"微软雅黑");
	m_font3.CreatePointFont(170, L"微软雅黑");
	m_font4.CreatePointFont(240, L"微软雅黑");
	setbtColor(&m_btfeature, RGB(0, 122, 204));
	m_btfeature.SetFont(&m_font1);
	m_btfeature.setfalseColor(RGB(255, 255, 0));
	setbtColor(&m_realTimePic, RGB(0, 122, 204));
	m_realTimePic.SetFont(&m_font1);
	m_realTimePic.setfalseColor(RGB(255, 255, 0));
	setbtColor(&m_btcurve, RGB(0, 122, 204));
	m_btcurve.SetFont(&m_font1);
	m_btcurve.setfalseColor(RGB(255, 255, 0));
	setbtColor(&m_flowEffect, RGB(241, 196, 15));
	m_flowEffect.SetFont(&m_font1);
	m_flowEffect.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_btflowEffect, RGB(241, 196, 15));
	m_btflowEffect.SetFont(&m_font4);
	m_btflowEffect.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_suggest, RGB(230, 127, 34));
	m_suggest.SetFont(&m_font1);
	m_suggest.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_btsuggest, RGB(230, 127, 34));
	m_btsuggest.SetFont(&m_font3);
	m_btsuggest.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_workCondition, RGB(232, 76, 61));
	m_workCondition.SetFont(&m_font1);
	m_workCondition.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_btworkCondition, RGB(232, 76, 61));
	m_btworkCondition.SetFont(&m_font3);
	m_btworkCondition.setfalseColor(RGB(255, 255, 255));
	setbtColor(&m_play, RGB(0, 122, 204));
	m_play.SetIcon(IDI_PLAY);
	setbtColor(&m_pause, RGB(0, 122, 204));
	m_pause.SetIcon(IDI_PAUSE);

	GetDlgItem(IDC_SHOWAVIS)->GetClientRect(&picrect);
	//showVedio();
	///////////////////////////为特征曲线图添加数值型的坐标轴///////////////////////////
	CChartAxis *pAxis = NULL;
	//pAxis = m_chartSize.CreateStandardAxis(CChartCtrl::BottomAxis);
	//pAxis->SetAutomatic(true);
	pAxis = m_chartSize.CreateStandardAxis(CChartCtrl::LeftAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartSize.CreateStandardAxis(CChartCtrl::BottomAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartSpeed.CreateStandardAxis(CChartCtrl::LeftAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartSpeed.CreateStandardAxis(CChartCtrl::BottomAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartTexture.CreateStandardAxis(CChartCtrl::LeftAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartTexture.CreateStandardAxis(CChartCtrl::BottomAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartColor.CreateStandardAxis(CChartCtrl::LeftAxis);
	pAxis->SetAutomatic(true);
	pAxis = m_chartColor.CreateStandardAxis(CChartCtrl::BottomAxis);
	pAxis->SetAutomatic(true);


	/////////////////////////////////////////////////////////////////////////////////
	/////////////////////////为特征曲线图添加左标题与下标题//////////////////////////
	CChartAxisLabel* pLabel = NULL;

	TChartString str1 = _T("泡沫大小");
	TChartString str2 = _T("泡沫速度");
	TChartString str3 = _T("泡沫稳定度");
	TChartString str4 = _T("红色分量");


	pAxis = m_chartSize.GetLeftAxis();
	if (pAxis)
		pLabel = pAxis->GetLabel();
	if (pLabel)
		pLabel->SetText(str1);
	pAxis = m_chartSpeed.GetLeftAxis();
	if (pAxis)
		pLabel = pAxis->GetLabel();
	if (pLabel)
		pLabel->SetText(str2);
	pAxis = m_chartTexture.GetLeftAxis();
	if (pAxis)
		pLabel = pAxis->GetLabel();
	if (pLabel)
		pLabel->SetText(str3);
	pAxis = m_chartColor.GetLeftAxis();
	if (pAxis)
		pLabel = pAxis->GetLabel();
	if (pLabel)
		pLabel->SetText(str4);
	// 	str1 = _T("数值坐标轴");
	// 	pAxis = m_chartCtr.GetBottomAxis();
	// 	if (pAxis)
//.........这里部分代码省略.........
开发者ID:Spritutu,项目名称:MonitorSYS,代码行数:101,代码来源:AntimonyDlg.cpp

示例4: Update

	void CNormalsChartsCtrl::Update()
	{
		string ID;

		if (m_pStation)
		{
			ID = m_pStation->m_ID;
		}

		CWVariables variables = m_pStation->GetVariables();
		CGraphVector chartsDefine = GetCharts(variables);


		if (ID != m_lastStationID ||
			chartsDefine != m_lastChartsDefine ||
			m_zoom != m_lastZoom)
		{


			m_lastStationID = ID;
			m_charts.clear();
			m_splitters.clear();
			m_scrollHelper->ScrollToOrigin(true, true);

			if (m_pStation != NULL && !ID.empty())
			{
				CWaitCursor waitCursor;
				CRegistry registry("Charts");

				//pre-compute total graphics height 
				int totalHeight = 0;
				for (CGraphVector::iterator it1 = chartsDefine.begin(); it1 != chartsDefine.end(); it1++)
					totalHeight += max(50, min(800, registry.GetValue<int>("height" + to_string(it1->m_series.front().m_variable), 150)));

				CRect rect;
				GetClientRectSB(this, rect);
				if (totalHeight > rect.Height())//if they have a scrollbar, remove width of crolbar
					rect.right -= ::GetSystemMetrics(SM_CXVSCROLL);


				int width = int(rect.Width()*m_zoom);// -10;
				int height = 0;


				int top = 0;
				for (CGraphVector::iterator it1 = chartsDefine.begin(); it1 != chartsDefine.end(); it1++)
				{
					int firstVar = it1->m_series.front().m_variable;
					int height = max(50, min(800, registry.GetValue<int>("height" + to_string(firstVar), 150)));

					CChartCtrlPtr pChart;
					pChart.reset(new CChartCtrl);
					pChart->Create(this, CRect(0, top, width, top + height), CHART_BASE_ID + firstVar, WS_CHILD | WS_VISIBLE);
					top += height;

					pChart->EnableRefresh(false);

					TChartString title = UtilWin::ToUTF16(it1->m_title);
					pChart->GetTitle()->SetVisible(title.empty());
					if (!title.empty())
						pChart->GetTitle()->AddString(title);

					pChart->GetLegend()->SetVisible(it1->m_bShowLegend);
					pChart->GetLegend()->DockLegend(CChartLegend::dsDockBottomLeft);
					pChart->GetLegend()->EnableShadow(false);
					pChart->GetLegend()->EnableBorder(false);
					pChart->GetLegend()->SetTransparent(true);

					pChart->SetPanEnabled(false);
					pChart->SetZoomEnabled(false);
					pChart->SetBackGradient(RGB(250, 250, 250), RGB(200, 200, 200), gtVertical);
					pChart->SetLineInfoEnabled(true);

					//****************
					//X
					CTPeriod period(CTRef(YEAR_NOT_INIT, JANUARY, 0, 0, CTM(CTM::MONTHLY, CTM::OVERALL_YEARS)), CTRef(YEAR_NOT_INIT, DECEMBER, 0, 0, CTM(CTM::MONTHLY, CTM::OVERALL_YEARS)));
					CChartTRefAxis* pAxisX = (CChartTRefAxis*)pChart->GetAxis(CChartCtrl::BottomAxis);
					if (pAxisX == NULL)
					{
						pAxisX = new CChartTRefAxis;
						pAxisX->SetMinMax(period.Begin(), period.End());
						pAxisX->SetReferenceTick(period.Begin());

						pAxisX->SetPanZoomEnabled(false);
						pAxisX->EnableScrollBar(false);
						pAxisX->SetAutoHideScrollBar(false);
						pAxisX->GetGrid()->SetBackColor(gtAlternate2, RGB(235, 235, 255), RGB(245, 245, 255));
						pChart->AttachCustomAxis(pAxisX, CChartCtrl::BottomAxis);
						TChartString lable = UtilWin::ToUTF16(it1->m_Xtitle);
						if (!lable.empty())
							pAxisX->GetLabel()->SetText(lable);
					}

					ENSURE(pAxisX);

					for (CGraphSerieVector::iterator it2 = it1->m_series.begin(); it2 != it1->m_series.end(); it2++)
					{
						//****************
						//Y
						CChartCtrl::EAxisPos axis = it2->m_YAxis == 0 ? CChartCtrl::LeftAxis : CChartCtrl::RightAxis;
//.........这里部分代码省略.........
开发者ID:RNCan,项目名称:WeatherBasedSimulationFramework,代码行数:101,代码来源:NormalsChartsCtrl.cpp

示例5: Update


//.........这里部分代码省略.........
					TChartString title = ToUTF16(it1->m_title);
					pChart->GetTitle()->SetVisible(title.empty());
					if (!title.empty())
						pChart->GetTitle()->AddString(title);

					pChart->GetLegend()->SetVisible(it1->m_bShowLegend);
					pChart->GetLegend()->DockLegend(CChartLegend::dsDockBottomLeft);
					pChart->GetLegend()->EnableShadow(false);
					pChart->GetLegend()->EnableBorder(false);
					pChart->GetLegend()->SetTransparent(true);

					pChart->SetPanEnabled(false);
					pChart->SetZoomEnabled(false);
					pChart->SetBackGradient(RGB(250, 250, 250), RGB(200, 200, 200), gtVertical);
					pChart->SetLineInfoEnabled(true);

					//****************
					//X

					CChartTRefAxis* pAxisX = (CChartTRefAxis*)pChart->GetAxis(CChartCtrl::BottomAxis);
					if (pAxisX == NULL)
					{
						pAxisX = new CChartTRefAxis;
						pAxisX->SetMinMax(period.Begin().GetRef(), period.End().GetRef());
						pAxisX->SetReferenceTick(period.Begin());

						pAxisX->SetPanZoomEnabled(false);
						pAxisX->EnableScrollBar(false);
						pAxisX->SetAutoHideScrollBar(false);
						pAxisX->GetGrid()->SetBackColor(gtAlternate2, RGB(235, 235, 255), RGB(245, 245, 255));
						pChart->AttachCustomAxis(pAxisX, CChartCtrl::BottomAxis);
						TChartString lable = ToUTF16(it1->m_Xtitle);
						if (!lable.empty())
							pAxisX->GetLabel()->SetText(lable);
					}

					ENSURE(pAxisX);

					for (CGraphSerieVector::iterator it2 = it1->m_series.begin(); it2 != it1->m_series.end(); it2++)
					{
						//****************
						//Y
						CChartCtrl::EAxisPos axis = it2->m_YAxis == 0 ? CChartCtrl::LeftAxis : CChartCtrl::RightAxis;
						CChartAxis* pAxisY = pChart->GetAxis(axis);
						if (pAxisY == NULL)
						{
							pAxisY = pChart->CreateStandardAxis(axis);
							pAxisY->SetAutomatic(true);
							pAxisY->SetPanZoomEnabled(false);
							pAxisY->EnableScrollBar(false);
							pAxisY->SetAutoHideScrollBar(false);
							TChartString lable = ToUTF16((it2->m_YAxis == 0) ? it1->m_Ytitle1 : it1->m_Ytitle2);
							pAxisY->GetLabel()->SetText(lable);

							//if (it2->m_YAxis == 1)
								//pAxisY->GetGrid()->SetVisible(false);
						}

						ENSURE(pAxisY);

						//****************
						//Series
						CChartXYSerie * pTheSerie = NULL;
						if (it2->m_type == CGraph::XY)
						{
							CChartPointsExSerie* pSerie = new CChartPointsExSerie(pChart.get());
开发者ID:RNCan,项目名称:WeatherBasedSimulationFramework,代码行数:67,代码来源:WeatherChartsCtrl.cpp


注:本文中的CChartAxis::GetLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。