|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.odesys.chart.ChartView | +--com.odesys.chart.piechart.PieChartView
PieChartView draws a Pie Chart in the Graphics context provided by its parent Chart Component.
Fields inherited from class com.odesys.chart.ChartView |
m_chart |
Constructor Summary | |
PieChartView(Chart chart)
Creates a new PieChartView instance for the specified Chart. |
Method Summary | |
float |
angleFromPoint(java.awt.Point p)
Gets the angle at the specified Point . |
float |
getChartHeight()
Gets the height of the chart side. |
float |
getChartRatio()
Gets the ratio between the two radiuses of the chart ellipse. |
float |
getDirection()
Gets the orientation of the chart in radians. |
float |
getExplodeRatio()
Gets the distance between the slices and the chart when exploded. |
float |
getHeightRatio()
Gets the ratio between the two height of the chart side and the main radius of the chart's ellipse. |
float |
getLabelsRatio()
Gets the distance between the labels and the chart. |
PieChartModel |
getModel()
|
float |
getPrecision()
Gets the rendering precision for the ellipse. |
int |
getRadius()
Gets the main radius of this PieChartView's ellipse. |
float |
getRelativeValue(float value)
Calculates the ratio of the specified value and the total value. |
void |
paint(java.awt.Graphics g)
Draws the Pie Chart in the specified Graphics context. |
java.awt.Point |
pointFromAngle(float angle)
Gets the Point at the periphery of the chart at the specified angle. |
java.awt.Point |
pointFromAngle(float angle,
int radius,
float ratio)
|
float |
radiusFromPoint(java.awt.Point p)
Gets the radius at the specified Point . |
protected void |
resizeToFit(java.awt.FontMetrics fm)
Resizes the Pie Chart to use all the available area. |
void |
setChartHeight(int height)
Sets the height of the chart side (height >= 0). |
void |
setChartRatio(float ratio)
Sets the ratio between the two radiuses of the chart ellipse (0.1 - 1.0). |
void |
setDirection(float direction)
Sets the orientation of the chart in radians. |
void |
setExplodeRatio(float explodeRatio)
Sets the distance between the slices and the chart when exploded. |
void |
setHeightRatio(float heightRatio)
Sets the ratio between the height of the chart and the main radius of the chart's ellipse. |
void |
setLabelsRatio(float labelsRatio)
Sets the distance between the labels and the chart. |
void |
setModel(ChartModel model)
Sets the data Model of this ChartView. |
void |
setPrecision(float precision)
Sets the rendering precision for the ellipse [0.01 - 0.2]. |
void |
setRadius(int radius)
Sets the main radius of this PieChartView's ellipse (radius >= 1). |
SliceData |
sliceDataFromPoint(java.awt.Point point)
Determines the SliceData instance (if any) associated with the specified Point. |
void |
updateAggregates()
Calculates the total value of this PieChartView's model. |
void |
updateDrawables()
Used internally to update the DrawableSlices and the DrawableLabels of this PieChartView. |
Methods inherited from class com.odesys.chart.ChartView |
getBackground, getFont, getForeground, getPreferredSize, isAutoScaleToFit, isContoursVisible, isLabelsVisible, location, repaint, reshape, setAutoScaleToFit, setBackground, setContoursVisible, setFont, setForeground, setLabelsVisible, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PieChartView(Chart chart)
Method Detail |
public void paint(java.awt.Graphics g)
paint
in class ChartView
protected void resizeToFit(java.awt.FontMetrics fm)
public void updateDrawables()
updateDrawables
in class ChartView
public void updateAggregates()
updateAggregates
in class ChartView
public float getRelativeValue(float value)
public void setModel(ChartModel model) throws java.lang.IllegalArgumentException
ChartView
setModel
in class ChartView
public PieChartModel getModel()
public SliceData sliceDataFromPoint(java.awt.Point point)
public float radiusFromPoint(java.awt.Point p)
Point
.
Point
is relative to the Component. (0, 0) is the
upper left corner of the component.Point
.public float angleFromPoint(java.awt.Point p)
Point
.
Point
is relative to the Component. (0, 0) is the
upper left corner of the component.Point
.public java.awt.Point pointFromAngle(float angle)
public java.awt.Point pointFromAngle(float angle, int radius, float ratio)
public void setRadius(int radius)
radius
- The main radius of the chart ellipse.public int getRadius()
public void setChartRatio(float ratio)
ratio
- The ratio between the two radiuses of the chart ellipse.public float getChartRatio()
public void setChartHeight(int height)
height
- The height of the chart side.public float getChartHeight()
public void setHeightRatio(float heightRatio)
heightRatio
- The ratio between the height of the chart and the main
radius of the chart's ellipse [0.0, 1.0].public float getHeightRatio()
public void setDirection(float direction)
direction
- The orientation of the chart in radians.public float getDirection()
public void setExplodeRatio(float explodeRatio)
explodeRatio
- How far from the char should the slices detach [1.0 - 1.5].public float getExplodeRatio()
public void setPrecision(float precision)
precision
- The rendering precision for the ellipse.public float getPrecision()
public void setLabelsRatio(float labelsRatio)
labelsRatio
- How far from the chart should the labels be [1.0 - 2.0].public float getLabelsRatio()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |