<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><divclass="CTitle logo"><divclass="nav"><aclass="nav"href="../../../index.php"><span>></span>Home</a><aclass="nav"href="../../../tests/"><span>></span>Examples</a><aclass="nav"href="../../../docs/"><span>></span>Docs</a><aclass="nav"href="http://bitbucket.org/cleonello/jqplot/downloads/"><span>></span>Download</a><aclass="nav"href="../../../info.php"><span>></span>Info</a><aclass="nav"href="../../../donate.php"><span>></span>Donate</a></div><aname="$.jqplot.PieRenderer"></a>$.jqplot.<wbr>PieRenderer</div><divclass=CBody><p>Plugin renderer to draw a pie chart. x values, if present, will be used as slice labels. y values give slice size.</p><p>To use this renderer, you need to include the pie renderer plugin, for example:</p><blockquote><pre><script type="text/javascript" src="plugins/jqplot.pieRenderer.js"></script></pre></blockquote><p>Properties described here are passed into the $.jqplot function as options on the series renderer. For example:</p><blockquote><pre>plot2 = $.jqplot('chart2', [s1, s2], {
seriesDefaults: {
renderer:$.jqplot.PieRenderer,
rendererOptions:{
sliceMargin: 2,
startAngle: -90
}
}
});</pre></blockquote><p>A pie plot will trigger events on the plot target according to user interaction. All events return the event object, the series index, the point (slice) index, and the point data for the appropriate slice.</p><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>’jqplotDataMouseOver’</td><tdclass=CDLDescription>triggered when user mouseing over a slice.</td></tr><tr><tdclass=CDLEntry>’jqplotDataHighlight’</td><tdclass=CDLDescription>triggered the first time user mouses over a slice, if highlighting is enabled.</td></tr><tr><tdclass=CDLEntry>’jqplotDataUnhighlight’</td><tdclass=CDLDescription>triggered when a user moves the mouse out of a highlighted slice.</td></tr><tr><tdclass=CDLEntry>’jqplotDataClick’</td><tdclass=CDLDescription>triggered when the user clicks on a slice.</td></tr><tr><tdclass=CDLEntry>’jqplotDataRightClick’</td><tdclass=CDLDescription>tiggered when the user right clicks on a slice if the “captureRightClick” option is set to true on the plot.</td></tr></table><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer">$.jqplot.<wbr>PieRenderer</a></td><tdclass=SDescription>Plugin renderer to draw a pie chart. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.Properties">Properties</a></td><tdclass=SDescription></td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.diameter"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">diameter</a></td><tdclass=SDescription>Outer diameter of the pie, auto computed by default</td></tr><trclass="SProperty SIndent2"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.padding"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">padding</a></td><tdclass=SDescription>padding between the pie and plot edges, legend, etc.</td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.sliceMargin"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">sliceMargin</a></td><tdclass=SDescription>angular spacing between pie slices in degrees.</td></tr><trclass="SProperty SIndent2"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.fill"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">fill</a></td><tdclass=SDescription>true or false, wether to fil the slices.</td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.shadowOffset"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">shadowOffset</a></td><tdclass=SDescription>offset of the shadow from the slice and offset of each succesive stroke of the shadow from the last.</td></tr><trclass="SProperty SIndent2"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.shadowAlpha"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">shadowAlpha</a></td><tdclass=SDescription>transparency of the shadow (0 = transparent, 1 = opaque)</td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.shadowDepth"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">shadowDepth</a></td><tdclass=SDescription>number of strokes to apply to the shadow, each stroke offset shadowOffset from the last.</td></tr><trclass="SProperty SIndent2"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.highlightMouseOver"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">highlightMouseOver</a></td><tdclass=SDescription>True to highlight slice when moused over. </td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieRenderer.highlightMouseDown"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.diameter"></a>diameter</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.diameter = null</td></tr></table></blockquote><p>Outer diameter of the pie, auto computed by default</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.padding"></a>padding</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.padding = 20</td></tr></table></blockquote><p>padding between the pie and plot edges, legend, etc.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.sliceMargin"></a>sliceMargin</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.sliceMargin = 0</td></tr></table></blockquote><p>angular spacing between pie slices in degrees.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.fill"></a>fill</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.fill = true</td></tr></table></blockquote><p>true or false, wether to fil the slices.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.shadowOffset"></a>shadowOffset</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowOffset = 2</td></tr></table></blockquote><p>offset of the shadow from the slice and offset of each succesive stroke of the shadow from the last.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.shadowAlpha"></a>shadowAlpha</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowAlpha = 0.07</td></tr></table></blockquote><p>transparency of the shadow (0 = transparent, 1 = opaque)</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.shadowDepth"></a>shadowDepth</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowDepth = 5</td></tr></table></blockquote><p>number of strokes to apply to the shadow, each stroke offset shadowOffset from the last.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.highlightMouseOver"></a>highlightMouseOver</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightMouseOver = true</td></tr></table></blockquote><p>True to highlight slice when moused over. This must be false to enable highlightMouseDown to highlight when clicking on a slice.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.highlightMouseDown"></a>highlightMouseDown</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightMouseDown = false</td></tr></table></blockquote><p>True to highlight when a mouse button is pressed over a slice. This will be disabled if highlightMouseOver is true.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.highlightColors"></a>highlightColors</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightColors = []</td></tr></table></blockquote><p>an array of colors to use when highlighting a slice.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabels"></a>dataLabels</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabels = 'percent'</td></tr></table></blockquote><p>Either ‘label’, ‘value’, ‘percent’ or an array of labels to place on the pie slices. Defaults to percentage of each pie slice.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.showDataLabels"></a>showDataLabels</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.showDataLabels = false</td></tr></table></blockquote><p>true to show data labels on slices.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabelFormatString"></a>dataLabelFormatString</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelFormatString = null</td></tr></table></blockquote><p>Format string for data labels. If none, ‘%s’ is used for “label” and for arrays, ‘%d’ for value and ‘%d%%’ for percentage.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabelThreshold"></a>dataLabelThreshold</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelThreshold = 3</td></tr></table></blockquote><p>Threshhold in percentage (0-100) of pie area, below which no label will be displayed. This applies to all label types, not just to percentage labels.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabelPositionFactor"></a>dataLabelPositionFactor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelPositionFactor = 0.52</td></tr></table></blockquote><p>A Multiplier (0-1) of the pie radius which controls position of label on slice. Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabelNudge"></a>dataLabelNudge</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelNudge = 2</td></tr></table></blockquote><p>Number of pixels to slide the label away from (+) or toward (-) the center of the pie.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.dataLabelCenterOn"></a>dataLabelCenterOn</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelCenterOn = true</td></tr></table></blockquote><p>True to center the data label at its position. False to set the inside facing edge of the label at its position.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieRenderer.startAngle"></a>startAngle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.startAngle = 0</td></tr></table></blockquote><p>Angle to start drawing pie in degrees. According to orientation of canvas coordinate system: 0 = on the positive x axis -90 = on the positive y axis. 90 = on the negaive y axis. 180 or - 180 = on the negative x axis.</p></div></div></div>
<divclass="CClass"><divclass=CTopic><h2class=CTitle><aname="$.jqplot.PieLegendRenderer"></a>$.jqplot.<wbr>PieLegendRenderer</h2><divclass=CBody><p>Legend Renderer specific to pie plots. Set by default when user creates a pie plot.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SGroup"><tdclass=SEntry><ahref="#$.jqplot.PieLegendRenderer.Properties">Properties</a></td><tdclass=SDescription></td></tr><trclass="SProperty SIndent1 SMarked"><tdclass=SEntry><ahref="#$.jqplot.PieLegendRenderer.numberRows"id=link21onMouseOver="ShowTip(event, 'tt19', 'link21')"onMouseOut="HideTip('tt19')">numberRows</a></td><tdclass=SDescription>Maximum number of rows in the legend. </td></tr><trclass="SProperty SIndent1"><tdclass=SEntry><ahref="#$.jqplot.PieLegendRenderer.numberColumns"id=link22onMouseOver="ShowTip(event, 'tt20', 'link22')"onMouseOut="HideTip('tt20')">numberColumns</a></td><tdclass=SDescription>Maximum number of columns in the legend. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieLegendRenderer.numberRows"></a>numberRows</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.numberRows = null</td></tr></table></blockquote><p>Maximum number of rows in the legend. 0 or null for unlimited.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.PieLegendRenderer.numberColumns"></a>numberColumns</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.numberColumns = null</td></tr></table></blockquote><p>Maximum number of columns in the legend. 0 or null for unlimited.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.diameter = null</td></tr></table></blockquote>Outer diameter of the pie, auto computed by default</div></div><divclass=CToolTipid="tt2"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.padding = 20</td></tr></table></blockquote>padding between the pie and plot edges, legend, etc.</div></div><divclass=CToolTipid="tt3"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.sliceMargin = 0</td></tr></table></blockquote>angular spacing between pie slices in degrees.</div></div><divclass=CToolTipid="tt4"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.fill = true</td></tr></table></blockquote>true or false, wether to fil the slices.</div></div><divclass=CToolTipid="tt5"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowOffset = 2</td></tr></table></blockquote>offset of the shadow from the slice and offset of each succesive stroke of the shadow from the last.</div></div><divclass=CToolTipid="tt6"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowAlpha = 0.07</td></tr></table></blockquote>transparency of the shadow (0 = transparent, 1 = opaque)</div></div><divclass=CToolTipid="tt7"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.shadowDepth = 5</td></tr></table></blockquote>number of strokes to apply to the shadow, each stroke offset shadowOffset from the last.</div></div><divclass=CToolTipid="tt8"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightMouseOver = true</td></tr></table></blockquote>True to highlight slice when moused over. </div></div><divclass=CToolTipid="tt9"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightMouseDown = false</td></tr></table></blockquote>True to highlight when a mouse button is pressed over a slice. </div></div><divclass=CToolTipid="tt10"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.highlightColors = []</td></tr></table></blockquote>an array of colors to use when highlighting a slice.</div></div><divclass=CToolTipid="tt11"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabels = 'percent'</td></tr></table></blockquote>Either ‘label’, ‘value’, ‘percent’ or an array of labels to place on the pie slices. </div></div><divclass=CToolTipid="tt12"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.showDataLabels = false</td></tr></table></blockquote>true to show data labels on slices.</div></div><divclass=CToolTipid="tt13"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelFormatString = null</td></tr></table></blockquote>Format string for data labels. </div></div><divclass=CToolTipid="tt14"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelThreshold = 3</td></tr></table></blockquote>Threshhold in percentage (0-100) of pie area, below which no label will be displayed. </div></div><divclass=CToolTipid="tt15"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelPositionFactor = 0.52</td></tr></table></blockquote>A Multiplier (0-1) of the pie radius which controls position of label on slice. </div></div><divclass=CToolTipid="tt16"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.dataLabelNudge = 2</td></tr></table></block