public class Arc extends PathDataGenerator
Four forms are possible:
Default innerRadius-, outerRadius-, startAngle- and endAngle-accessor functions assume the input data is an object with named attributes matching the accessors.
While the default accessors assume that the arc dimensions are all specified dynamically, it is very common to set one or more of the dimensions as a constant, such as setting the inner radius to zero for a pie chart.
The Arc function generates path data for a closed solid arc, as in a pie or donut chart.
Modifier | Constructor and Description |
---|---|
protected |
Arc() |
Modifier and Type | Method and Description |
---|---|
Array<Double> |
centroid(com.google.gwt.core.client.JavaScriptObject datum,
int index)
Computes the centroid of the arc that would be generated from the
specified input arguments; typically, the arguments are the current datum
(d), and optionally the current index (i).
|
static Arc |
constantArc()
Create an instance of
Arc with all properties initialized to 0. |
static Arc |
copy(Arc oldArc)
Create a new arc with properties initialized with the given arc
|
double |
endAngle() |
Arc |
endAngle(double endAngle)
Set the end angle in radians of the Arc.
|
double |
innerRadius() |
Arc |
innerRadius(double innerRadius)
Set the inner radius of the Arc.
|
double |
outerRadius() |
Arc |
outerRadius(double outerRadius)
Set the outerRadius of the Arc.
|
Arc |
setOrInvokeSetter(String propName,
double value) |
double |
startAngle() |
Arc |
startAngle(double startAngle)
Set the start angle in radians of the Arc.
|
generate, generate, generate, generate
public final double innerRadius()
public final Arc innerRadius(double innerRadius)
radius
- public final double outerRadius()
public final Arc outerRadius(double outerRadius)
radius
- public final double startAngle()
public final Arc startAngle(double startAngle)
Angles are specified in radians, even though SVG typically uses degrees. The angle 0 corresponds to 12 o'clock (negative y) and continues clockwise repeating at 2xPI.
startAngle
- the angle in radianspublic final double endAngle()
public final Arc endAngle(double endAngle)
Angles are specified in radians, even though SVG typically uses degrees. The angle 0 corresponds to 12 o'clock (negative y) and continues clockwise repeating at 2xPI.
endAngle
- the angle in radianspublic final Array<Double> centroid(com.google.gwt.core.client.JavaScriptObject datum, int index)
The centroid is defined as the midpoint in polar coordinates of the inner and outer radius, and the start and end angle. This provides a convenient location for arc labels.
datum
- index
- public static Arc constantArc()
Arc
with all properties initialized to 0.
Useful to define an arc with constants.Copyright © 2015 gwt-d3. All rights reserved.