<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : How to get Xaxis value on chart click</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Chart Control : How to get Xaxis value on chart click]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 21 May 2026 05:36:11 +0000</pubDate>
  <lastBuildDate>Tue, 14 Feb 2012 14:11:37 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=19310</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[How to get Xaxis value on chart click :    Found a solution.  You...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67614&amp;title=how-to-get-xaxis-value-on-chart-click#67614</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7331">seanma</a><br /><strong>Subject:</strong> 19310<br /><strong>Posted:</strong> 14 February 2012 at 2:11pm<br /><br />Found a solution.<br><br>You will need to define your own derived class of CXTPChartControl, for example myCXTPChartCtrl<br>and in your derived class, for example, you defined OnLButtonDblClk function,<br><br>void myCXTPChartCtrl::OnLButtonDblClk( UINT nFlags, CPoint point )<br>{<br>&nbsp;&nbsp; // here you get which point your mouse click at<br>&nbsp;&nbsp; CXTPChartElement* hit =&nbsp; HitTest ( point );<br><br>&nbsp;&nbsp; // if the hitted element is valid type<br>&nbsp;&nbsp; if( hit )<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if you want to check which data point your clicked on the chart series<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPChartSeriesPoint* pPoint = DYNAMIC_DOWNCAST( CXTPChartSeriesPoint, hit );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if your hit is actually a point on the series<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( pPoint )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do whatever you want, for example, get the actual value<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double value = pPoint-&gt;GetArgumentValue();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>The same way, you can get other type of element in the chart  (for example, xAxis, yAxis, labels, chart series, markers, legends etc), remember everything is derived class of CXTPChartElement, so you only need to cast them to the type you want.<br><br>Happy coding!]]>
   </description>
   <pubDate>Tue, 14 Feb 2012 14:11:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67614&amp;title=how-to-get-xaxis-value-on-chart-click#67614</guid>
  </item> 
  <item>
   <title><![CDATA[How to get Xaxis value on chart click :  You want to look at MultipleView.cpp...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67336&amp;title=how-to-get-xaxis-value-on-chart-click#67336</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7235">SlateColt</a><br /><strong>Subject:</strong> 19310<br /><strong>Posted:</strong> 05 January 2012 at 11:05am<br /><br /><p>You want to look at MultipleView.cpp in the chart browser sample app in the OnChartClick method, then add something like this below it:</p><div>&nbsp;</div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">if</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">( DYNAMIC_DOWNCAST( CXTPChartSeriesPoint, pElement ) )</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">{</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">&nbsp;&nbsp; CXTPChartSeriesPoint* pPoint = (CXTPChartSeriesPoint*)pElement;</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">&nbsp;&nbsp; TRACE( "clicked series point: %03d value: %4.2f\n", (int)pPoint-&gt;GetArgumentValue(),</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">&nbsp;&nbsp;&nbsp;pPoint-&gt;GetValue(0) );</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">}</font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font>&nbsp;</div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">Hope this helps...</font></font></div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><div></div></font><div></div></font><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><p>}</p></font><p></p></font><p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font></p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font></div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font>]]>
   </description>
   <pubDate>Thu, 05 Jan 2012 11:05:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67336&amp;title=how-to-get-xaxis-value-on-chart-click#67336</guid>
  </item> 
  <item>
   <title><![CDATA[How to get Xaxis value on chart click : I want to get corresponding Xaxis...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67181&amp;title=how-to-get-xaxis-value-on-chart-click#67181</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7243">mohitagandotra</a><br /><strong>Subject:</strong> 19310<br /><strong>Posted:</strong> 15 December 2011 at 7:45am<br /><br />I want to get corresponding Xaxis value whenever CXTPChart is clicked. On chart click i can get the mouse cursor position and in CAxisView there is a function "double ValueToPoint(double)", to which i can pass the current mouse cursor position and "ValueToPoint" function will return corresponding XAxis value. My query is how to access ValueToPoint function as I dont have view class object. Do I need to create my own view for this..]]>
   </description>
   <pubDate>Thu, 15 Dec 2011 07:45:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19310&amp;PID=67181&amp;title=how-to-get-xaxis-value-on-chart-click#67181</guid>
  </item> 
 </channel>
</rss>