<piechart>
The piechart component allows for the creation of a pie chart using series data.

JavaScript: lz.piechart
extends <chart> » <basecomponent> » <view> » <node> » lz.Eventable »
[Warning] Warning
This component is of Beta quality and is subject to change.

The following is a piechart that uses series data.

Example 60. Simple piechart

<canvas height="400" width="400">    
                        <dataset name="baseball" src="resources/pie-data.xml"/> 

                        <piechart id="chart1" width="500" height="500" dataPointsEnabled="true" datalabelEnabled="true" datalabelColumn="y" style="defaultchartstyle">
                            <dataseries datapath="baseball:/records">
                                <datacolumn name="x" columndatapath="record/@year" datatype="number"/> 
                                <dataseries label="wins">                
                                    <datacolumn name="y" columndatapath="record/@wins" datatype="number"/>
                                </dataseries>  
                                <datacolumn name="tooltip" columndatapath="record">
                                        <method name="processData" args="v">
                                            return  "year: " + v.attributes.year + "  wins: " +
                                                v.attributes.wins;
                                        </method>
                                </datacolumn>                        
                            </dataseries> 

                            <strokestyle name="pieslicestyle" strokeColor="0x000000" strokeWidth="2" strokeType="dotted"/>
                            <legend name="legendbox" legendFontsize="14" initstage="late" legendborder="false">
                                <handler name="onitemmouseover" args="item">
                                    var piepiece = parent.plotarea.arrPiePieces[item.identifier];
                                    piepiece.renderInnerWedge();
                                </handler>

                                <handler name="onitemmouseout" args="item">
                                    var piepiece = parent.plotarea.arrPiePieces[item.identifier];
                                    piepiece.renderWedge();
                                </handler>
                            </legend>

                        </piechart>
                    </canvas>
edit

A pie chart represents a chart that is displayed in the 2D polar plane. This class inherits immediately from chart class and can be instantiated directly. (Warning: Of beta quality.)

Methods

renderDataLabels()
piechart.renderDataLabels();
Renders the labels that display the values of the data series.

renderPlotArea()
piechart.renderPlotArea();
Renders the plot area which is an instance of the piechartplotarea class. The plot area requires to read a group of two data series, one for the groups that are represented by the pie slices and the second for their values.

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy