Package com.day.cq.graphics.chart
Class PieChart
- java.lang.Object
-
- com.day.cq.graphics.chart.Chart
-
- com.day.cq.graphics.chart.PieChart
-
public class PieChart extends Chart
ThePieChart
class implements drawing a pie chart from data samples. From each data row only the first sample is taken to draw the pie. The slices are drawn counter clock wise, last row to first starting at thestart
angle as defined withsetStart(double)
. As a side effect the theticksample
data in the Y axis of the graph is set to the percentage of the sum of sample values. Seedraw(Graph, boolean)
for more information.
-
-
Field Summary
-
Fields inherited from class com.day.cq.graphics.chart.Chart
chartTypes
-
-
Constructor Summary
Constructors Constructor Description PieChart()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Layer
draw(Graph graph, boolean doDraw)
Draws the pie chart into a new layer of the defined height and width.static java.lang.String
getName()
void
setHeight(int height)
Sets the height of the pie chart, if it has not been set yet.void
setStart(double start)
Sets the starting angle of the first pie piece, if it has not been set yet.void
setWidth(int width)
Sets the width of the pie chart, if it has not been set yet.-
Methods inherited from class com.day.cq.graphics.chart.Chart
getInstance
-
-
-
-
Method Detail
-
getName
public static java.lang.String getName()
-
draw
public Layer draw(Graph graph, boolean doDraw)
Draws the pie chart into a new layer of the defined height and width. As noted in the above class comment, this method sets theticksample
value of the graph's Y axis as the chart is drawn. This method can thus be used to simply calculate this data.
-
setWidth
public void setWidth(int width)
Sets the width of the pie chart, if it has not been set yet.- Parameters:
width
- The width of the pie chart.
-
setHeight
public void setHeight(int height)
Sets the height of the pie chart, if it has not been set yet.- Parameters:
height
- The height of the pie chart.
-
setStart
public void setStart(double start)
Sets the starting angle of the first pie piece, if it has not been set yet. This angle is considered to be in degrees, to rotate counter clockwise for positive values. Zero degrees is at 3 o'clock.- Parameters:
start
-
-
-