egroupware/api/js/jquery/jqplot/docs/files/plugins/jqplot-pointLabels-js.html

72 lines
23 KiB
HTML
Raw Normal View History

2013-10-24 22:24:26 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>$.jqplot.PointLabels</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.4 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><div class="CTitle logo"><div class="nav"><a class="nav" href="../../../index.php"><span>&gt;</span>Home</a><a class="nav" href="../../../tests/"><span>&gt;</span>Examples</a><a class="nav" href="../../../docs/"><span>&gt;</span>Docs</a><a class="nav" href="http://bitbucket.org/cleonello/jqplot/downloads/"><span>&gt;</span>Download</a><a class="nav" href="../../../info.php"><span>&gt;</span>Info</a><a class="nav" href="../../../donate.php"><span>&gt;</span>Donate</a></div><a name="$.jqplot.PointLabels"></a>$.jqplot.<wbr>PointLabels</div><div class=CBody><p>Plugin for putting labels at the data points.</p><p>To use this plugin, include the js file in your source:</p><blockquote><pre>&lt;script type=&quot;text/javascript&quot; src=&quot;plugins/jqplot.pointLabels.js&quot;&gt;&lt;/script&gt;</pre></blockquote><p>By default, the last value in the data ponit array in the data series is used for the label.&nbsp; For most series renderers, extra data can be added to the data point arrays and the last value will be used as the label.</p><p>For instance, this series:</p><blockquote><pre>[[1,4], [3,5], [7,2]]</pre></blockquote><p>Would, by default, use the y values in the labels.&nbsp; Extra data can be added to the series like so:</p><blockquote><pre>[[1,4,'mid'], [3 5,'hi'], [7,2,'low']]</pre></blockquote><p>And now the point labels would be &lsquo;mid&rsquo;, &lsquo;low&rsquo;, and &lsquo;hi&rsquo;.</p><p>Options to the point labels and a custom labels array can be passed into the &ldquo;pointLabels&rdquo; option on the series option like so:</p><blockquote><pre>series:[{pointLabels:{
labels:['mid', 'hi', 'low'],
location:'se',
ypadding: 12
}
}]</pre></blockquote><p>A custom labels array in the options takes precendence over any labels in the series data.&nbsp; If you have a custom labels array in the options, but still want to use values from the series array as labels, set the &ldquo;labelsFromSeries&rdquo; option to true.</p><p>By default, html entities (&lt;, &gt;, etc.) are escaped in point labels.&nbsp; If you want to include actual html markup in the labels, set the &ldquo;escapeHTML&rdquo; option to false.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#$.jqplot.PointLabels" >$.jqplot.<wbr>PointLabels</a></td><td class=SDescription>Plugin for putting labels at the data points.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#$.jqplot.PointLabels.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.show" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">show</a></td><td class=SDescription>show the labels or not.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#$.jqplot.PointLabels.location" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">location</a></td><td class=SDescription>compass location where to position the label around the point. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.labelsFromSeries" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">labelsFromSeries</a></td><td class=SDescription>true to use labels within data point arrays.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#$.jqplot.PointLabels.seriesLabelIndex" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">seriesLabelIndex</a></td><td class=SDescription>array index for location of labels within data point arrays. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.labels" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">labels</a></td><td class=SDescription>array of arrays of labels, one array for each series.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#$.jqplot.PointLabels.stackedValue" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">stackedValue</a></td><td class=SDescription>true to display value as stacked in a stacked plot. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.ypadding" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">ypadding</a></td><td class=SDescription>vertical padding in pixels between point and label</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#$.jqplot.PointLabels.xpadding" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">xpadding</a></td><td class=SDescription>horizontal padding in pixels between point and label</td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.escapeHTML" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">escapeHTML</a></td><td class=SDescription>true to escape html entities in the labels. </td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#$.jqplot.PointLabels.edgeTolerance" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">edgeTolerance</a></td><td class=SDescription>Number of pixels that the label must be away from an axis boundary in order to be drawn. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#$.jqplot.PointLabels.formatter" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">formatter</a></td><td class=SDescription>A class of a formatter for the tick text. </td></tr><tr class="SProperty SIndent2"><td c
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.Properties"></a>Properties</h3></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.show"></a>show</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.show = $.jqplot.config.enablePlugins</td></tr></table></blockquote><p>show the labels or not.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.location"></a>location</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.location = 'n'</td></tr></table></blockquote><p>compass location where to position the label around the point.&nbsp; &lsquo;n&rsquo;, &lsquo;ne&rsquo;, &lsquo;e&rsquo;, &lsquo;se&rsquo;, &lsquo;s&rsquo;, &lsquo;sw&rsquo;, &lsquo;w&rsquo;, &lsquo;nw&rsquo;</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.labelsFromSeries"></a>labelsFromSeries</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.labelsFromSeries = false</td></tr></table></blockquote><p>true to use labels within data point arrays.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.seriesLabelIndex"></a>seriesLabelIndex</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.seriesLabelIndex = null</td></tr></table></blockquote><p>array index for location of labels within data point arrays. if null, will use the last element of the data point array.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.labels"></a>labels</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.labels = []</td></tr></table></blockquote><p>array of arrays of labels, one array for each series.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.stackedValue"></a>stackedValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.stackedValue = false</td></tr></table></blockquote><p>true to display value as stacked in a stacked plot. no effect if labels is specified.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.ypadding"></a>ypadding</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.ypadding = 6</td></tr></table></blockquote><p>vertical padding in pixels between point and label</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.xpadding"></a>xpadding</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.xpadding = 6</td></tr></table></blockquote><p>horizontal padding in pixels between point and label</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.escapeHTML"></a>escapeHTML</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.escapeHTML = true</td></tr></table></blockquote><p>true to escape html entities in the labels.&nbsp; If you want to include markup in the labels, set to false.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.edgeTolerance"></a>edgeTolerance</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.edgeTolerance = -5</td></tr></table></blockquote><p>Number of pixels that the label must be away from an axis boundary in order to be drawn.&nbsp; Negative values will allow overlap with the grid boundaries.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.formatter"></a>formatter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.formatter = $.jqplot.DefaultTickFormatter</td></tr></table></blockquote><p>A class of a formatter for the tick text.&nbsp; sprintf by default.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.formatString"></a>formatString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.formatString = ''</td></tr></table></blockquote><p>string passed to the formatter.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="$.jqplot.PointLabels.hideZeros"></a>hideZeros</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.hideZeros = false</td></tr></table></blockquote><p>true to not show a label for a value which is 0.</p></div></div></div>
</div><!--Content-->
<div id=Footer>Copyright &copy; 2009 - 2010 Chris Leonello&nbsp; &middot;&nbsp; Updated March 26th, 2013&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<div id=Menu><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Usage and Options</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../usage-txt.html">Usage</a></div></div><div class=MEntry><div class=MFile><a href="../jqPlotOptions-txt.html">jqPlot Options</a></div></div><div class=MEntry><div class=MFile><a href="../optionsTutorial-txt.html">Options Tutorial</a></div></div><div class=MEntry><div class=MFile><a href="../jqPlotCssStyling-txt.html">jqPlot CSS Customization</a></div></div><div class=MEntry><div class=MFile><a href="../changes-txt.html">Change Log</a></div></div><div class=MEntry><div class=MLink><a href="../../tests/">Examples</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">API Documentation</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../jqplot-core-js.html">jqPlot Charts</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Core Renderers</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../jqplot-axisTickRenderer-js.html">Axis Tick Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-canvasGridRenderer-js.html">Canvas Grid Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-divTitleRenderer-js.html">Div Title Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-linearAxisRenderer-js.html">Linear Axis Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-markerRenderer-js.html">Marker Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-shapeRenderer-js.html">Shape Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-shadowRenderer-js.html">Shadow Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-lineRenderer-js.html">Line Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-axisLabelRenderer-js.html">Axis Label Renderer</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-themeEngine-js.html">Theme Engine</a></div></div><div class=MEntry><div class=MFile><a href="../jqplot-toImage-js.html">fn</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Plugins</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="jqplot-barRenderer-js.html">jqplot.<wbr>BarRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-BezierCurveRenderer-js.html">jqplot.<wbr>BezierCurveRenderer.js</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-blockRenderer-js.html">jqplot.<wbr>BlockRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-bubbleRenderer-js.html">jqplot.<wbr>BubbleRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-canvasAxisLabelRenderer-js.html">jqplot.<wbr>CanvasAxisLabelRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-canvasAxisTickRenderer-js.html">jqplot.<wbr>CanvasAxisTickRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-pyramidGridRenderer-js.html">jqplot.<wbr>CanvasGridRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-canvasOverlay-js.html">jqplot.<wbr>CanvasOverlay</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-categoryAxisRenderer-js.html">jqplot.<wbr>CategoryAxisRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-ciParser-js.html">jqplot.<wbr>ciParser</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-cursor-js.html">jqplot.<wbr>Cursor</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-dateAxisRenderer-js.html">jqplot.<wbr>DateAxisRenderer</a></div></div><div class=MEntry><div class=MFile><a href="jqplot-donutRenderer-js.html">jqplot.<wbr>DonutRenderer</a></div></div><div class=MEntry><div class=M
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Hooks">Hooks</option><option value="Properties">Properties</option></select></div><script language=JavaScript><!--
HideAllBut([3, 4], 6);// --></script></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.show = $.jqplot.config.enablePlugins</td></tr></table></blockquote>show the labels or not.</div></div><div class=CToolTip id="tt2"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.location = 'n'</td></tr></table></blockquote>compass location where to position the label around the point. </div></div><div class=CToolTip id="tt3"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.labelsFromSeries = false</td></tr></table></blockquote>true to use labels within data point arrays.</div></div><div class=CToolTip id="tt4"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.seriesLabelIndex = null</td></tr></table></blockquote>array index for location of labels within data point arrays. </div></div><div class=CToolTip id="tt5"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.labels = []</td></tr></table></blockquote>array of arrays of labels, one array for each series.</div></div><div class=CToolTip id="tt6"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.stackedValue = false</td></tr></table></blockquote>true to display value as stacked in a stacked plot. </div></div><div class=CToolTip id="tt7"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.ypadding = 6</td></tr></table></blockquote>vertical padding in pixels between point and label</div></div><div class=CToolTip id="tt8"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.xpadding = 6</td></tr></table></blockquote>horizontal padding in pixels between point and label</div></div><div class=CToolTip id="tt9"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.escapeHTML = true</td></tr></table></blockquote>true to escape html entities in the labels. </div></div><div class=CToolTip id="tt10"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.edgeTolerance = -5</td></tr></table></blockquote>Number of pixels that the label must be away from an axis boundary in order to be drawn. </div></div><div class=CToolTip id="tt11"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.formatter = $.jqplot.DefaultTickFormatter</td></tr></table></blockquote>A class of a formatter for the tick text. </div></div><div class=CToolTip id="tt12"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.formatString = ''</td></tr></table></blockquote>string passed to the formatter.</div></div><div class=CToolTip id="tt13"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>this.hideZeros = false</td></tr></table></blockquote>true to not show a label for a value which is 0.</div></div><!--END_ND_TOOLTIPS-->
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
2011-08-10 01:10:50 +02:00
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>