Click here to Skip to main content
15,861,168 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.1M   99.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: CChartLineSerie Class 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>CChartLineSerie Class Reference</h1><!-- doxytag: class="CChartLineSerie" --><!-- doxytag: inherits="CChartXYSerie" -->Specialization of a <a class="el" href="class_c_chart_serie.html" title="Abstract class that provides a common &quot;interface&quot; for all series in the...">CChartSerie</a> to display a line series.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="_chart_line_serie_8h-source.html">ChartLineSerie.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for CChartLineSerie:</div>
<div class="dynsection">

<p><center><img src="class_c_chart_line_serie.png" usemap="#CChartLineSerie_map" border="0" alt=""></center>
<map name="CChartLineSerie_map">
<area href="class_c_chart_x_y_serie.html" alt="CChartXYSerie" shape="rect" coords="0,112,219,136">
<area href="class_c_chart_serie_base.html" alt="CChartSerieBase< SChartXYPoint >" shape="rect" coords="0,56,219,80">
<area href="class_c_chart_serie.html" alt="CChartSerie" shape="rect" coords="0,0,219,24">
</map>
</div>

<p>
<a href="class_c_chart_line_serie-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">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#b2f2633d0e4c2780ee41a26e6a3492f5">GetPenStyle</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the pen style (plain, dashed, dotted, ...).  <a href="#b2f2633d0e4c2780ee41a26e6a3492f5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#ba44000020146023fee8a8288a431622">SetPenStyle</a> (int NewStyle)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the pen style (plain, dashed, dotted, ...).  <a href="#ba44000020146023fee8a8288a431622"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4b5b1152532fc9cc0c9fd3ddc71a20db"></a><!-- doxytag: member="CChartLineSerie::GetWidth" ref="4b5b1152532fc9cc0c9fd3ddc71a20db" args="() const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#4b5b1152532fc9cc0c9fd3ddc71a20db">GetWidth</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the pen width. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2af961d832b31887abb5e760422a1ef9"></a><!-- doxytag: member="CChartLineSerie::SetWidth" ref="2af961d832b31887abb5e760422a1ef9" args="(int PenWidth)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#2af961d832b31887abb5e760422a1ef9">SetWidth</a> (int PenWidth)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the pen width. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6fd06f0fe61a9a901a1a9f38eb93a41d"></a><!-- doxytag: member="CChartLineSerie::SetSmooth" ref="6fd06f0fe61a9a901a1a9f38eb93a41d" args="(bool bSmooth)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#6fd06f0fe61a9a901a1a9f38eb93a41d">SetSmooth</a> (bool bSmooth)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables the smoothing of the curve (slower). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="17fc1db38a517bfad155825f20429838"></a><!-- doxytag: member="CChartLineSerie::CChartLineSerie" ref="17fc1db38a517bfad155825f20429838" args="(CChartCtrl *pParent)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#17fc1db38a517bfad155825f20429838">CChartLineSerie</a> (<a class="el" href="class_c_chart_ctrl.html">CChartCtrl</a> *pParent)</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="48e4ad1596894ed696491362f68dd722"></a><!-- doxytag: member="CChartLineSerie::~CChartLineSerie" ref="48e4ad1596894ed696491362f68dd722" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#48e4ad1596894ed696491362f68dd722">~CChartLineSerie</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">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_line_serie.html#d30c44e96b7551d1d4576da40ac683f6">IsPointOnSerie</a> (const CPoint &amp;screenPoint, unsigned &amp;uIndex) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check whether a screen point is on the series.  <a href="#d30c44e96b7551d1d4576da40ac683f6"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Specialization of a <a class="el" href="class_c_chart_serie.html" title="Abstract class that provides a common &quot;interface&quot; for all series in the...">CChartSerie</a> to display a line series. 
<p>
The data points are connected by line segments. The curve can also be smoothed. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="b2f2633d0e4c2780ee41a26e6a3492f5"></a><!-- doxytag: member="CChartLineSerie::GetPenStyle" ref="b2f2633d0e4c2780ee41a26e6a3492f5" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CChartLineSerie::GetPenStyle           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the pen style (plain, dashed, dotted, ...). 
<p>
For a list of pen styles available, see the CreatePen function in MSDN. 
</div>
</div><p>
<a class="anchor" name="d30c44e96b7551d1d4576da40ac683f6"></a><!-- doxytag: member="CChartLineSerie::IsPointOnSerie" ref="d30c44e96b7551d1d4576da40ac683f6" args="(const CPoint &amp;screenPoint, unsigned &amp;uIndex) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CChartLineSerie::IsPointOnSerie           </td>
          <td>(</td>
          <td class="paramtype">const CPoint &amp;&nbsp;</td>
          <td class="paramname"> <em>screenPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned &amp;&nbsp;</td>
          <td class="paramname"> <em>uIndex</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Check whether a screen point is on the series. 
<p>
This function returns true if the screen point is close to a line segment. If the screen point is also close to a specific point of the series, the index of the point is stored in the uIndex parameter. Otherwise, this parameter contains INVALID_POINT. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>screenPoint</em>&nbsp;</td><td>The screen point to test </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>uIndex</em>&nbsp;</td><td>If the point is close to a specific point of the series, its index is stored here. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if the point is on the series </dd></dl>

<p>Implements <a class="el" href="class_c_chart_serie.html#941aec6162f5b449fc570bc5063fb076">CChartSerie</a>.</p>

</div>
</div><p>
<a class="anchor" name="ba44000020146023fee8a8288a431622"></a><!-- doxytag: member="CChartLineSerie::SetPenStyle" ref="ba44000020146023fee8a8288a431622" args="(int NewStyle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CChartLineSerie::SetPenStyle           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>NewStyle</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the pen style (plain, dashed, dotted, ...). 
<p>
For a list of pen styles available, see the CreatePen function in MSDN. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>E:/Sources Misc/ChartDemo/ChartCtrl/<a class="el" href="_chart_line_serie_8h-source.html">ChartLineSerie.h</a><li>E:/Sources Misc/ChartDemo/ChartCtrl/ChartLineSerie.cpp</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