![]() |
ChartElement type |
Post Reply
|
| Author | |
Minieggs
Newbie
Joined: 20 March 2012 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: ChartElement typePosted: 20 March 2012 at 9:45am |
|
Hi All
When using ChartElement how can you tell what type of element the returned handle points to ?
Thanks
|
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2012 at 9:21am |
|
Something like this: void CMarkupTitleView::OnChartClick(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) { CPoint pt; GetCursorPos(&pt); m_wndChartControl.ScreenToClient(&pt); CXTPChartElement* pElement = m_wndChartControl.HitTest(pt); if (DYNAMIC_DOWNCAST(CXTPChartTitle, pElement)) { CXTPChartTitle* pTitle = (CXTPChartTitle*)pElement; SetTitle(pTitle); } else if (DYNAMIC_DOWNCAST(CXTPChartAxis, pElement)) { CXTPChartAxis* pAxis = (CXTPChartAxis*)pElement; pAxis->GetTitle()->SetVisible(TRUE); pAxis->GetTitle()->SetText(_T("Clicked On Axis")); //SetTitle(pTitle); } else if (DYNAMIC_DOWNCAST(CXTPChartSeriesPoint, pElement)) { CXTPChartSeriesPoint* pPoint = (CXTPChartSeriesPoint*)pElement; TRACE(_T("Clicked on point with value: %i and argument: %s\n"), (int)pPoint->GetValue(0), pPoint->GetArgument()); } else { SetTitle(NULL); } }
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |