Click here to Skip to main content
15,885,195 members
Articles / Desktop Programming / MFC

High-speed Charting Control

Rate me:
Please Sign up or sign in to vote.
4.95/5 (327 votes)
13 Jul 2010CPOL35 min read 4.2M   100.5K   787  
A flexible charting control to display 2D data
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChartDemo: CChartLabelProvider&lt; PointType &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CChartLabelProvider&lt; PointType &gt; Class Template Reference</h1><!-- doxytag: class="CChartLabelProvider" -->Interface which should be implemented in order to provide text to a label.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="_chart_label_8h-source.html">ChartLabel.h</a>&gt;</code>
<p>

<p>
<a href="class_c_chart_label_provider-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc5d2e9d973ee6f4fc6e62d4b48edca2"></a><!-- doxytag: member="CChartLabelProvider::CChartLabelProvider" ref="fc5d2e9d973ee6f4fc6e62d4b48edca2" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_label_provider.html#fc5d2e9d973ee6f4fc6e62d4b48edca2">CChartLabelProvider</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a55954f86930b3f6e0488259cd9742e7"></a><!-- doxytag: member="CChartLabelProvider::~CChartLabelProvider" ref="a55954f86930b3f6e0488259cd9742e7" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_label_provider.html#a55954f86930b3f6e0488259cd9742e7">~CChartLabelProvider</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual TChartString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_label_provider.html#46f5e0217500131d8341c3c0994c0e22">GetText</a> (<a class="el" href="class_c_chart_serie_base.html">CChartSerieBase</a>&lt; PointType &gt; *pSerie, unsigned PointIndex)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Method to override in order to provide the text of the label.  <a href="#46f5e0217500131d8341c3c0994c0e22"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class PointType&gt;<br>
 class CChartLabelProvider&lt; PointType &gt;</h3>

Interface which should be implemented in order to provide text to a label. 
<p>
This class is a template class with the template parameter being the point type of the series to which the label is attached.<p>
Using a <a class="el" href="class_c_chart_label_provider.html" title="Interface which should be implemented in order to provide text to a label.">CChartLabelProvider</a> provides more flexibility in the way to supply text to the label. You can for instance embedd in the string some information about the point (XValue, YValue, index, ...). In that case, a single <a class="el" href="class_c_chart_label_provider.html" title="Interface which should be implemented in order to provide text to a label.">CChartLabelProvider</a> object can be provided for all labels. Changing the displayed text of all labels becomes also easier: you only have to adapt the string returned by this object and refresh the control and all labels will be updated. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="46f5e0217500131d8341c3c0994c0e22"></a><!-- doxytag: member="CChartLabelProvider::GetText" ref="46f5e0217500131d8341c3c0994c0e22" args="(CChartSerieBase&lt; PointType &gt; *pSerie, unsigned PointIndex)=0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class PointType&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual TChartString <a class="el" href="class_c_chart_label_provider.html">CChartLabelProvider</a>&lt; PointType &gt;::GetText           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_c_chart_serie_base.html">CChartSerieBase</a>&lt; PointType &gt; *&nbsp;</td>
          <td class="paramname"> <em>pSerie</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>PointIndex</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Method to override in order to provide the text of the label. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pSerie</em>&nbsp;</td><td>The series to which the label is attached </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uPtIndex</em>&nbsp;</td><td>The index of the point in the series to which the label is attached </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a string which will be the text displayed in the label. </dd></dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>E:/Sources Misc/ChartDemo/ChartCtrl/<a class="el" href="_chart_label_8h-source.html">ChartLabel.h</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jan 17 13:33:11 2010 for ChartDemo by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Belgium Belgium
I am a 29 years old guy and I live with my girlfriend in Hoegaarden, little city from Belgium well known for its white beer Smile | :) .
I studied as an industrial engineer in electronics but I oriented myself more towards software development when I started to work.
Currently I am working in a research centre in mechatronica. I mainly develop in C++ but I also do a bit of Java.
When I have so spare time, I like to read (mainly fantasy) and play electric guitar.

Comments and Discussions