Package com.storedobject.svg.chart
Class Pie
java.lang.Object
com.storedobject.svg.Svg
com.storedobject.svg.chart.Chart
com.storedobject.svg.chart.Pie
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.svg.Svg
Svg.Anchor, Svg.Margin, Svg.Mover, Svg.Scale, Svg.ScaleTo -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()Build the pie chart SVG.doubleGet the margin.final booleanisDonut()Check if the chart is a donut chart.voidsetDonutHoleRadius(double donutHoleRadius) Set the radius of the donut hole.voidsetMargin(double margin) Set the margin.voidsetRadius(double radius) Set the radius of the pie.voidsetShowLegend(boolean showLegend) Set whether to show the legend.Methods inherited from class com.storedobject.svg.chart.Chart
addValue, addValue, colorize, getValues, isBuilt, setLabelName, setUnit, setValueNameMethods inherited from class com.storedobject.svg.Svg
add, add, add, escapeXml, flipHorizontally, flipVertically, getFilledSvg, getHeight, getScaledSvg, getSvg, getWidth, getX, getY, margin, margin, scale, scale, scaleTo, scaleToHeight, scaleToWidth, toString
-
Constructor Details
-
Pie
public Pie()Constructor. -
Pie
public Pie(double radius) Constructor with radius.- Parameters:
radius- Radius of the chart.
-
Pie
Constructor with values and radius.- Parameters:
values- Values to be plotted.radius- Radius of the chart.
-
Pie
-
-
Method Details
-
setRadius
public void setRadius(double radius) Set the radius of the pie.- Parameters:
radius- Radius in pixels.
-
setDonutHoleRadius
public void setDonutHoleRadius(double donutHoleRadius) Set the radius of the donut hole. If set, the chart becomes a donut chart.- Parameters:
donutHoleRadius- Radius of the donut hole in pixels.
-
isDonut
public final boolean isDonut()Check if the chart is a donut chart.- Returns:
- True if donut chart.
-
setShowLegend
public void setShowLegend(boolean showLegend) Set whether to show the legend.- Parameters:
showLegend- True to show the legend.
-
setMargin
public void setMargin(double margin) Set the margin.- Parameters:
margin- Margin.
-
getMargin
public double getMargin()Get the margin.- Returns:
- Margin.
-
build
-