public class IlvSinglePieRenderer extends IlvSingleChartRenderer
IlvSinglePieRenderer
instances are used by the
IlvPieChartRenderer
class to display several data sets.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EXPLODE_RATIO
The default explode ratio for pie slices.
|
AREA, BAR, BUBBLE, CANDLE, CENTERED_LABEL_LAYOUT, COMBO, DATA_LABEL, DEFAULT_LABEL_LAYOUT, DEFAULT_LABELING, HILO, HILO_ARROW, HILO_STICK, HLOC, OUTSIDE_LABEL_LAYOUT, PERCENT_LABEL, PIE, POLYLINE, SCATTER, STACKED_AREA, STACKED_BAR, STACKED_DIVERGING_BAR, STACKED_POLYLINE, STACKED_STAIR, STACKED100_AREA, STACKED100_BAR, STACKED100_POLYLINE, STACKED100_STAIR, STAIR, SUMMED_STAIR, SUPERIMPOSED_BAR, TREEMAP, X_VALUE_LABEL, XY_VALUES_LABEL, Y_VALUE_LABEL
Constructor and Description |
---|
IlvSinglePieRenderer()
Creates a new pie renderer.
|
IlvSinglePieRenderer(IlvStyle style)
Creates a new pie renderer with the specified style.
|
Modifier and Type | Method and Description |
---|---|
void |
applyDataSetStyle(ilog.views.chart.styling.IlvDataSetStyle dataSetStyle)
Applies the styles for a data set.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the renderer is added to or removed from a chart.
|
String |
computeDataLabel(IlvDataSetPoint dp)
Computes the data label associated with the specified point.
|
Point |
computeDataLabelLocation(IlvDisplayPoint dp,
Dimension size)
Computes the location of the data label associated with the specified
point.
|
IlvLegendItem[] |
createLegendItems()
Creates the legend items associated with this renderer.
|
protected void |
dataSetsAdded(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are connected to this renderer.
|
protected void |
dataSetsRemoved(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are disconnected from this renderer.
|
void |
drawLegendSymbol(IlvLegendItem item,
Graphics g,
int x,
int y,
int w,
int h)
Draws the symbol of the specified legend item.
|
void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style,
IlvDataSet dataSet,
int index)
Draws a data point with selection handles.
|
int |
getExplodeRatio(int dataIdx)
Returns the explode ratio of the slice displaying the specified point.
|
String |
getLegendText(IlvLegendItem item)
Returns the label of the specified legend item.
|
double |
getPartialSum(int dataIdx)
Returns the sum of the y-values of all the data points that are displayed
before the specified data point.
|
Insets |
getPreferredMargins()
Returns the preferred margins of this renderer for the calculation of the
plotting rectangle.
|
double |
getSlicePercent(int dataIdx)
Returns the percentage of the specified slice.
|
IlvStyle |
getSliceStyle(int dataIdx)
Returns the style for the specified data point.
|
IlvDataInterval |
getYRange(int dataIdx,
IlvDataInterval range)
Returns the Y range covered by the specified slice.
|
boolean |
has3DSupport()
Indicates whether this renderer supports three-dimensional drawing.
|
boolean |
isExploded(int dataIdx)
Indicates whether the slice displaying the specified point is exploded.
|
boolean |
isStrokeOn()
Indicates whether the outline of the slices is drawn.
|
void |
setExploded(int dataIdx,
boolean exploded)
Toggles the exploded state of the slice displaying the specified point.
|
void |
setExplodeRatio(int explodeRatio)
Applies the specified explode ratio to all the slices.
|
void |
setExplodeRatio(int dataIdx,
int explodeRatio)
Sets the explode ratio of the slice displaying the specified point.
|
void |
setSliceColors(Color[] colors)
Specifies the color of the pie slices.
|
void |
setSliceStyle(int dataIdx,
IlvStyle style)
Sets the style for the specified data point.
|
void |
setStrokeOn(boolean strokeOn)
Specifies whether the outline of the slices is drawn.
|
addImageMapAreas, applyStyles, dataSetContentsChanged, dataSetPropertyChanged, draw, draw, drawAnnotations, drawIntoHitmap, drawSelectionHandles, drawSelectionHandles, getAnnotation, getBounds, getBounds, getDefaultLegendText, getDisplayItem, getDisplayPoint, getDisplayStyle, getNearestItem, getNearestPoint, getRenderingHint, getRenderingHint, getStyle, getStyle, getStyles, getXRange, getYRange, getYRange, getZAnnotationText, holdsAnnotations, isFilled, makeDefaultStyle, set3D, setAnnotation, setAnnotation, setDataPoint, setDisplayPoint, setRenderingHint, setRenderingHint, setStyle, setStyles, toDisplay, toDisplay
applyStyles, applyStyles, collectDisplayItems, create, createRenderer, dataSetsChangesBatchEnding, dataSetsChangesBatchStarting, dispose, drawSelectionHandles, endRendererChanges, findAppropriateColor, fireTreemapFocusEvent, getAnnotation, getBounds, getChart, getChild, getChildCount, getChildIterator, getChildren, getClipRect, getCoordinateSystem, getDataLabeling, getDataLabelLayout, getDataLabelling, getDataSetIndex, getDataSetMainIndex, getDataSetMainRenderer, getDataSource, getDefaultColors, getDefaultLegendTitle, getDepths, getDisplayItem, getDisplayItems, getLegendStyle, getMinDataSetCount, getName, getNearestItem, getNearestPoint, getParent, getPlotRect, getRenderingHint, getStyle, getVirtualDataSet, getXShift, getYAxisIdx, isDisplayingDataSet, isViewable, isVisible, isVisibleInLegend, reDraw, register, setAnnotation, setDataLabeling, setDataLabelLayout, setDataLabelling, setDataSource, setName, setParent, setRenderingHint, setRenderingHintWithNoDraw, setStyle, setVisible, setVisibleInLegend, setXShift, setYAxisIdx, startRendererChanges, toData, triggerChange
public static final int DEFAULT_EXPLODE_RATIO
public IlvSinglePieRenderer()
public IlvSinglePieRenderer(IlvStyle style)
public boolean has3DSupport()
has3DSupport
in interface IlvChart3DSupport
has3DSupport
in class IlvChartRenderer
true
protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected
in class IlvSingleChartRenderer
oldChart
- The chart which this renderer was associated to. This parameter is
null
if this renderer is added to a new chart.newChart
- The chart which this renderer is added to. This parameter is
null
if this renderer is removed from its current
chart.public void setSliceStyle(int dataIdx, IlvStyle style)
dataIdx
- The index of the considered data point.style
- The new style.public final IlvStyle getSliceStyle(int dataIdx)
dataIdx
- The index of the considered data point.public void applyDataSetStyle(ilog.views.chart.styling.IlvDataSetStyle dataSetStyle)
applyDataSetStyle
in class IlvSingleChartRenderer
public void setSliceColors(Color[] colors)
public final boolean isStrokeOn()
setStrokeOn(boolean)
public void setStrokeOn(boolean strokeOn)
strokeOn
- A boolean value indicating whether the outline of the
slices is drawn. This property overrides the setting of each slice
rendering style.setSliceStyle(int, ilog.views.chart.IlvStyle)
,
setSliceColors(java.awt.Color[])
public final boolean isExploded(int dataIdx)
public final void setExploded(int dataIdx, boolean exploded)
setExplodeRatio(int, int)
public final int getExplodeRatio(int dataIdx)
dataIdx
- The index of the considered data point.0
means
that the slice is not exploded.isExploded(int)
,
setExplodeRatio(int, int)
public void setExplodeRatio(int dataIdx, int explodeRatio)
dataIdx
- The index of the considered data point.explodeRatio
- A value between 0
and 100
.
The distance between the slice and the center of the chart increases
proportionally with this value.getExplodeRatio(int)
public void setExplodeRatio(int explodeRatio)
setExplodeRatio(int, int)
public double getSlicePercent(int dataIdx)
public double getPartialSum(int dataIdx)
dataIdx
- The index of the considered data point (this point is
included in the returned sum).public Insets getPreferredMargins()
getPreferredMargins
in class IlvSingleChartRenderer
IlvChart.Area.getMargins()
protected void dataSetsRemoved(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsRemoved
in class IlvSingleChartRenderer
firstIdx
- The index of the first data set.lastIdx
- The index of the last data set.oldDataSets
- The data sets previously connected to this renderer.protected void dataSetsAdded(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsAdded
in class IlvSingleChartRenderer
firstIdx
- The index of the first data set.lastIdx
- The index of the last data set.oldDataSets
- The data sets previously connected to this renderer.public Point computeDataLabelLocation(IlvDisplayPoint dp, Dimension size)
computeDataLabelLocation
in class IlvChartRenderer
dp
- The considered display point.size
- The size of the label.IlvChartRenderer.setDataLabeling(int)
public String computeDataLabel(IlvDataSetPoint dp)
IlvChartRenderer.PERCENT_LABEL
labeling mode.computeDataLabel
in class IlvChartRenderer
dp
- The considered data point.null
if none is available.public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style, IlvDataSet dataSet, int index)
drawSelectionHandles
in class IlvChartRenderer
g
- A graphics context.style
- The graphic style parameters.dataSet
- One of the data sets of this renderer's data source.index
- The index of a data point in the data set.public IlvDataInterval getYRange(int dataIdx, IlvDataInterval range)
dataIdx
- The index of the considered data point.range
- An interval used to store the result. If this parameter
is null
, a new IlvDataInterval
is allocated.public String getLegendText(IlvLegendItem item)
getLegendText
in class IlvSingleChartRenderer
IlvSingleChartRenderer.getDefaultLegendText()
method.public IlvLegendItem[] createLegendItems()
IlvPieRendererLegendItem
for each data point displayed by this renderer.createLegendItems
in class IlvSingleChartRenderer
null
.IlvPieRendererLegendItem
public void drawLegendSymbol(IlvLegendItem item, Graphics g, int x, int y, int w, int h)
drawLegendSymbol
in class IlvSingleChartRenderer
item
- The legend item to draw.g
- The graphics context.x
- The symbol x-coordinate.y
- The symbol y-coordinate.w
- The symbol width.h
- The symbol height.IlvRendererLegendItem
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.