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
ThePieChartclass 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 thestartangle as defined withsetStart(double). As a side effect the theticksampledata 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 Layerdraw(Graph graph, boolean doDraw)Draws the pie chart into a new layer of the defined height and width.static java.lang.StringgetName()voidsetHeight(int height)Sets the height of the pie chart, if it has not been set yet.voidsetStart(double start)Sets the starting angle of the first pie piece, if it has not been set yet.voidsetWidth(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 theticksamplevalue 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-
-
-