本文整理汇总了C++中CChartAxis::SetAutomatic方法的典型用法代码示例。如果您正苦于以下问题:C++ CChartAxis::SetAutomatic方法的具体用法?C++ CChartAxis::SetAutomatic怎么用?C++ CChartAxis::SetAutomatic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChartAxis
的用法示例。
在下文中一共展示了CChartAxis::SetAutomatic方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBnClickedAxisautomaticCheck
void CRegisterValueAnalyzerDlg::OnBnClickedAxisautomaticCheck()
{
CChartAxis* pAxis = GetSelectedAxis();
if ( ((CButton*)GetDlgItem(IDC_AXISAUTOMATIC_CHECK))->GetCheck() == 1)
pAxis->SetAutomatic(true);
else
{
TCHAR szBuffer[255];
double MinVal=0, MaxVal=0;
m_AxisMinValEdit.GetWindowText(szBuffer,254);
// MinVal = _tstof(szBuffer);
MinVal = _tcstod(szBuffer, NULL);
m_AxisMaxValEdit.GetWindowText(szBuffer,254);
// MaxVal = _tstof(szBuffer);
MaxVal = _tcstod(szBuffer, NULL);
if (MinVal > MaxVal)
{
MessageBox(_T("MinVal > MaxVal"),_T("Error"),MB_OK);
((CButton*)GetDlgItem(IDC_AXISAUTOMATIC_CHECK))->SetCheck(1);
return;
}
pAxis->SetAutomatic(false);
pAxis->SetMinMax(MinVal,MaxVal);
}
m_ChartCtrl.RefreshCtrl();
}
示例2: 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)
//.........这里部分代码省略.........
示例3: Update
//.........这里部分代码省略.........
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;
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 = UtilWin::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());
pChart->AttachCustomSerie(pSerie, false, it2->m_YAxis != 0);
//general
TChartString varName = WBSF::convert(GetFieldHeader(it2->m_variable));
pSerie->SetName(varName);
pSerie->EnableShadow(it2->m_bEnableShadow);
pSerie->SetShadowDepth(it2->m_shadowDepth);
pSerie->SetShadowColor(it2->m_shadowColor);
//point
pSerie->SetPointType((CChartPointsExSerie::PointType)it2->m_symbolType);
pSerie->SetPointSize(it2->m_symbolWidth, it2->m_symbolHeight);
pSerie->SetColor(it2->m_symbolColor);
pSerie->SetFillPoint(it2->m_bSymbolFilled);
示例4: Update
//.........这里部分代码省略.........
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());
pChart->AttachCustomSerie(pSerie, false, it2->m_YAxis != 0);
//general
TChartString varName = WBSF::convert(GetVariableName(it2->m_variable));
pSerie->SetName(varName);
pSerie->EnableShadow(it2->m_bEnableShadow);
pSerie->SetShadowDepth(it2->m_shadowDepth);
pSerie->SetShadowColor(it2->m_shadowColor);
//point
pSerie->SetPointType((CChartPointsExSerie::PointType)it2->m_symbolType);
pSerie->SetPointSize(it2->m_symbolWidth, it2->m_symbolHeight);
pSerie->SetColor(it2->m_symbolColor);
pSerie->SetFillPoint(it2->m_bSymbolFilled);