Package com.pdfjet
Class DonutChart
java.lang.Object
com.pdfjet.DonutChart
- All Implemented Interfaces:
Drawable
A donut or pie chart: each slice is its value's share of the sum of the
values, with a label next to it and its percentage inside it. A chart with
an inner radius of 0 is a pie chart. See Example_28.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a slice to this chart.float[]Draws this chart on the specified page.setAltDescription(String altDescription) Sets the alternate description of the chart, which a screen reader reads in a PDF/UA document, where the chart is a figure.setLocation(float x, float y) Sets the top left corner of the outer circle of this chart.setRadii(float outerRadius, float innerRadius) Sets the outer and inner radius of this chart.
-
Constructor Details
-
DonutChart
Creates a donut chart. With an inner radius of 0 it is a pie chart.- Parameters:
f1- the font for the slice labels.f2- the font for the percentages drawn inside the slices.
-
-
Method Details
-
setLocation
Sets the top left corner of the outer circle of this chart. The center is one outer radius to the right of it and one below. The slice labels can extend past the circle.- Specified by:
setLocationin interfaceDrawable- Parameters:
x- the x coordinate of the top left corner.y- the y coordinate of the top left corner.- Returns:
- this DonutChart object.
-
setRadii
Sets the outer and inner radius of this chart.- Parameters:
outerRadius- the outer radius.innerRadius- the inner radius; 0 for a pie chart.- Returns:
- this DonutChart object.
-
addSlice
Adds a slice to this chart.- Parameters:
slice- the slice.- Returns:
- this DonutChart object.
-
setAltDescription
Sets the alternate description of the chart, which a screen reader reads in a PDF/UA document, where the chart is a figure. The default lists the label and the percentage of each slice.- Parameters:
altDescription- the alternate description.- Returns:
- this DonutChart object.
-
drawOn
Draws this chart on the specified page.
-