Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

High-speed Charting Control

, 13 Jul 2010 CPOL
A flexible charting control to display 2D data
chartcrtl_src.zip
ChartCtrl_demo.zip
ChartDemo
ChartCtrl
.svn
all-wcprops
entries
format
prop-base
props
text-base
ChartAxis.cpp.svn-base
ChartAxis.h.svn-base
ChartAxisLabel.cpp.svn-base
ChartAxisLabel.h.svn-base
ChartBalloonLabel.h.svn-base
ChartBalloonLabel.inl.svn-base
ChartBarSerie.cpp.svn-base
ChartBarSerie.h.svn-base
ChartCandlestickSerie.cpp.svn-base
ChartCandlestickSerie.h.svn-base
ChartCrossHairCursor.cpp.svn-base
ChartCrossHairCursor.h.svn-base
ChartCtrl.cpp.svn-base
ChartCtrl.h.svn-base
ChartCursor.cpp.svn-base
ChartCursor.h.svn-base
ChartDateTimeAxis.cpp.svn-base
ChartDateTimeAxis.h.svn-base
ChartDragLineCursor.cpp.svn-base
ChartDragLineCursor.h.svn-base
ChartFont.cpp.svn-base
ChartFont.h.svn-base
ChartGanttSerie.cpp.svn-base
ChartGanttSerie.h.svn-base
ChartGradient.cpp.svn-base
ChartGradient.h.svn-base
ChartGrid.cpp.svn-base
ChartGrid.h.svn-base
ChartLabel.h.svn-base
ChartLabel.inl.svn-base
ChartLegend.cpp.svn-base
ChartLegend.h.svn-base
ChartLineSerie.cpp.svn-base
ChartLineSerie.h.svn-base
ChartLogarithmicAxis.cpp.svn-base
ChartLogarithmicAxis.h.svn-base
ChartMouseListener.h.svn-base
ChartPointsArray.h.svn-base
ChartPointsArray.inl.svn-base
ChartPointsSerie.cpp.svn-base
ChartPointsSerie.h.svn-base
ChartScrollBar.cpp.svn-base
ChartScrollBar.h.svn-base
ChartSerie.cpp.svn-base
ChartSerie.h.svn-base
ChartSerieBase.h.svn-base
ChartSerieBase.inl.svn-base
ChartSeriesMouseListener.h.svn-base
ChartStandardAxis.cpp.svn-base
ChartStandardAxis.h.svn-base
ChartString.h.svn-base
ChartSurfaceSerie.cpp.svn-base
ChartSurfaceSerie.h.svn-base
ChartTitle.cpp.svn-base
ChartTitle.h.svn-base
ChartXYSerie.cpp.svn-base
ChartXYSerie.h.svn-base
PointsOrdering.h.svn-base
tmp
prop-base
props
text-base
ChartBalloonLabel.inl
ChartCtrl_source.zip
ChartLabel.inl
ChartPointsArray.inl
ChartSerieBase.inl
ChartDemo.dsp
ChartDemo.dsw
ColourPicker
.svn
entries
format
prop-base
props
text-base
ColourPicker.cpp.svn-base
ColourPicker.h.svn-base
ColourPopup.cpp.svn-base
ColourPopup.h.svn-base
tmp
prop-base
props
text-base
Doc
html
class_c_chart_axis.png
class_c_chart_balloon_label.png
class_c_chart_bar_serie.png
class_c_chart_candlestick_serie.png
class_c_chart_cross_hair_cursor.png
class_c_chart_cursor.png
class_c_chart_date_time_axis.png
class_c_chart_drag_line_cursor.png
class_c_chart_gantt_serie.png
class_c_chart_label.png
class_c_chart_line_serie.png
class_c_chart_logarithmic_axis.png
class_c_chart_points_serie.png
class_c_chart_serie.png
class_c_chart_serie_base.png
class_c_chart_standard_axis.png
class_c_chart_surface_serie.png
class_c_chart_x_y_serie.png
doxygen.png
tab_b.gif
tab_l.gif
tab_r.gif
res
ChartDemo.ico
ChartCtrl_doxygen.zip
html
class_c_chart_axis.png
class_c_chart_balloon_label.png
class_c_chart_bar_serie.png
class_c_chart_candlestick_serie.png
class_c_chart_cross_hair_cursor.png
class_c_chart_cursor.png
class_c_chart_date_time_axis.png
class_c_chart_drag_line_cursor.png
class_c_chart_gantt_serie.png
class_c_chart_label.png
class_c_chart_line_serie.png
class_c_chart_logarithmic_axis.png
class_c_chart_points_serie.png
class_c_chart_serie.png
class_c_chart_serie_base.png
class_c_chart_standard_axis.png
class_c_chart_surface_serie.png
class_c_chart_x_y_serie.png
doxygen.png
tab_b.gif
tab_l.gif
tab_r.gif
ChartCtrl_source.zip
ChartLabel.inl
ChartPointsArray.inl
ChartSerieBase.inl
ChartBalloonLabel.inl
chartctrl_src.zip
chartctr_demo.zip
ChartDemo.clw
ChartDemo.dsp
ChartDemo.dsw
res
ChartDemo.ico
<!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: CChartLegend 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>CChartLegend Class Reference</h1><!-- doxytag: class="CChartLegend" -->This class is responsible for the legend displayed on the control.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="_chart_legend_8h-source.html">ChartLegend.h</a>&gt;</code>
<p>

<p>
<a href="class_c_chart_legend-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 Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#b638f2259d00f46816a5c0bba7529a54">DockSide</a> { <b>dsDockRight</b>, 
<b>dsDockLeft</b>, 
<b>dsDockTop</b>, 
<b>dsDockBottom</b>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enumeration specifying on which side of the control the legend is docked. <br></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="a23df25eefd5506133162db7b291fdfe"></a><!-- doxytag: member="CChartLegend::SetFont" ref="a23df25eefd5506133162db7b291fdfe" args="(int iPointSize, const TChartString &amp;strFaceName)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#a23df25eefd5506133162db7b291fdfe">SetFont</a> (int iPointSize, const TChartString &amp;strFaceName)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the font used to display the series names. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="37edaeb7516a4c0e0473f30afd211aec"></a><!-- doxytag: member="CChartLegend::DockLegend" ref="37edaeb7516a4c0e0473f30afd211aec" args="(DockSide dsSide)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#37edaeb7516a4c0e0473f30afd211aec">DockLegend</a> (<a class="el" href="class_c_chart_legend.html#b638f2259d00f46816a5c0bba7529a54">DockSide</a> dsSide)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dock the legend on a specific side of the control. Default is right. <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_legend.html#398a83f500e7d3ec88b53baac0caa8f9">UndockLegend</a> (int iLeftPos, int iTopPos)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Undock the legend.  <a href="#398a83f500e7d3ec88b53baac0caa8f9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="316543887a3a6af4a4133049a6574130"></a><!-- doxytag: member="CChartLegend::SetTransparent" ref="316543887a3a6af4a4133049a6574130" args="(bool bTransparent)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#316543887a3a6af4a4133049a6574130">SetTransparent</a> (bool bTransparent)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the background of the legend transparent. <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_legend.html#0bb7fb625a300c260390c96422db725b">SetHorizontalMode</a> (bool bHorizontal)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the legend in horizontal/vertical mode.  <a href="#0bb7fb625a300c260390c96422db725b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ea145cd45c337496e726a9a958205f1b"></a><!-- doxytag: member="CChartLegend::SetVisible" ref="ea145cd45c337496e726a9a958205f1b" args="(bool bVisible)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#ea145cd45c337496e726a9a958205f1b">SetVisible</a> (bool bVisible)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the legend visible/invisible. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b2c65ac7823a1551eff83709f4310ddf"></a><!-- doxytag: member="CChartLegend::IsVisible" ref="b2c65ac7823a1551eff83709f4310ddf" args="() const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#b2c65ac7823a1551eff83709f4310ddf">IsVisible</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the legend is visible. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="03431c7ae2764527fead0db1f129c187"></a><!-- doxytag: member="CChartLegend::GetBackColor" ref="03431c7ae2764527fead0db1f129c187" args="() const " -->
COLORREF&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#03431c7ae2764527fead0db1f129c187">GetBackColor</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the back color of the legend. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="949ef9f6d4d372efec72017fa5d101d6"></a><!-- doxytag: member="CChartLegend::SetBackColor" ref="949ef9f6d4d372efec72017fa5d101d6" args="(COLORREF NewColor)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#949ef9f6d4d372efec72017fa5d101d6">SetBackColor</a> (COLORREF NewColor)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the back color of the legend. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="89ee10fed100ff1b19c16908bc79491d"></a><!-- doxytag: member="CChartLegend::GetShadowColor" ref="89ee10fed100ff1b19c16908bc79491d" args="() const " -->
COLORREF&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#89ee10fed100ff1b19c16908bc79491d">GetShadowColor</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the shadow color. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="db9a437ec8a341503bcf03ad8f04b780"></a><!-- doxytag: member="CChartLegend::SetShadowColor" ref="db9a437ec8a341503bcf03ad8f04b780" args="(COLORREF NewColor)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#db9a437ec8a341503bcf03ad8f04b780">SetShadowColor</a> (COLORREF NewColor)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the shadow color. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3e492ab1e36f3e861b82dd688f35ab2b"></a><!-- doxytag: member="CChartLegend::EnableShadow" ref="3e492ab1e36f3e861b82dd688f35ab2b" args="(bool bEnable)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#3e492ab1e36f3e861b82dd688f35ab2b">EnableShadow</a> (bool bEnable)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables/disables the shadow. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4fe2a3537a6f8474cd2fe5010ecb0dcc"></a><!-- doxytag: member="CChartLegend::SetShadowDepth" ref="4fe2a3537a6f8474cd2fe5010ecb0dcc" args="(int Depth)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#4fe2a3537a6f8474cd2fe5010ecb0dcc">SetShadowDepth</a> (int Depth)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the shadow depth (in pixels). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="de42499c29132ecdda476afb6a9b366c"></a><!-- doxytag: member="CChartLegend::IsPointInside" ref="de42499c29132ecdda476afb6a9b366c" args="(const CPoint &amp;screenPoint) const " -->
BOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_chart_legend.html#de42499c29132ecdda476afb6a9b366c">IsPointInside</a> (const CPoint &amp;screenPoint) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the screen point is on the legend region. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class is responsible for the legend displayed on the control. 
<p>
Series which are named will be displayed in the legend. The legend object is retrieved by calling the GetLegend() function on the <a class="el" href="class_c_chart_ctrl.html" title="The main chart control class.">CChartCtrl</a> class. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="0bb7fb625a300c260390c96422db725b"></a><!-- doxytag: member="CChartLegend::SetHorizontalMode" ref="0bb7fb625a300c260390c96422db725b" args="(bool bHorizontal)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CChartLegend::SetHorizontalMode           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bHorizontal</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the legend in horizontal/vertical mode. 
<p>
In horizontal mode, the names are drawn next to each other instead of on top of each other. 
</div>
</div><p>
<a class="anchor" name="398a83f500e7d3ec88b53baac0caa8f9"></a><!-- doxytag: member="CChartLegend::UndockLegend" ref="398a83f500e7d3ec88b53baac0caa8f9" args="(int iLeftPos, int iTopPos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CChartLegend::UndockLegend           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>iLeftPos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>iTopPos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Undock the legend. 
<p>
When the legend is undocked (floating), it doesn't take any margin size but is drawn on top of the control at the specified location (it can be above the plotting area for instance). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>iLeftPos</em>&nbsp;</td><td>The left position of the legend, in pixels (from the left of the control) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>iTopPos</em>&nbsp;</td><td>The top position of the legend, in pixels (from the top of the control) </td></tr>
  </table>
</dl>

</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_legend_8h-source.html">ChartLegend.h</a><li>E:/Sources Misc/ChartDemo/ChartCtrl/ChartLegend.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)

Share

About the Author

Cedric Moonen
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.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 13 Jul 2010
Article Copyright 2006 by Cedric Moonen
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid