Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - ChartElement type
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ChartElement type

 Post Reply Post Reply
Author
Message
Minieggs View Drop Down
Newbie
Newbie


Joined: 20 March 2012
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Minieggs Quote  Post ReplyReply Direct Link To This Post Topic: ChartElement type
    Posted: 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
 
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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);
}
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.