Package com.day.cq.graphics.chart
Class PieChart
java.lang.Object
com.day.cq.graphics.chart.Chart
com.day.cq.graphics.chart.PieChart
The
PieChart 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 the
start angle as defined with setStart(double).
As a side effect the the ticksample data in the Y axis of the
graph is set to the percentage of the sum of sample values. See
draw(Graph, boolean) for more information.-
Field Summary
Fields inherited from class com.day.cq.graphics.chart.Chart
chartTypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDraws the pie chart into a new layer of the defined height and width.static 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
-
Constructor Details
-
PieChart
public PieChart()
-
-
Method Details
-
getName
-
draw
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-
-