public class IlvHiLoChartRenderer extends IlvCompositeChartRenderer implements IlvVariableWidthRenderer
IlvHiLoChartRenderer
class defines 3 representation modes:
CLUSTERED
, CANDLE
and OPENCLOSE
.
In CLUSTERED
mode, this class creates an instance of
IlvSingleHiLoRenderer
for every pair (maximum 2) of data
sets, in the low/high order. The type of the child renderers is determined
according to the type
property (see setType(int)
), and
should match one of the IlvSingleHiLoRenderer
types. Note
that the type
property only makes sense with the
CLUSTERED
mode.
In OPENCLOSE
mode, the required number of data sets is 4:
2 data sets (the first ones) for the high/low representation plus 2 data sets
for the start/end representation, each representation corresponding to an
IlvSingleHiLoRenderer
instance (of type STICK
and MARKED
, respectively).
The CANDLE
mode only differs from OPENCLOSE
mode by the graphic representation used: the high/low representation is of
type STICK
, the open/close being of type BAR
.
The following pictures show the representation of each mode in the following
order: CANDLE
, OPENCLOSE
and CLUSTERED/BAR
with 2 children.
IlvSingleHiLoRenderer
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CANDLE
The candle mode.
|
static int |
CLUSTERED
The clustered mode.
|
static int |
OPENCLOSE
The openclose mode.
|
AREA, BAR, BUBBLE, 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
DEFAULT_WIDTH
Constructor and Description |
---|
IlvHiLoChartRenderer()
Creates a new High-Low chart, in
CLUSTERED BAR
mode, with a default width. |
IlvHiLoChartRenderer(int mode,
int type,
double widthPercent)
Creates a new High-Low chart.
|
Modifier and Type | Method and Description |
---|---|
protected IlvChartRenderer |
createChild(IlvDataSet dataSet)
Creates an instance of
IlvSingleHiLoRenderer to
display the specified data set. |
IlvLegendItem[] |
createLegendItems()
Creates the legend item instances associated to this renderer.
|
protected void |
dataSetsAdded(int firstIdx,
int lastIdx,
IlvDataSet[] oldDataSets)
Called when data sets are connected to this renderer.
|
protected void |
dataSetsChangesBatchEnding()
Called when a series of data sets insertions or removals is terminating.
|
protected void |
dataSetsChangesBatchStarting()
Called when a series of data sets insertions or removals is starting.
|
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 given legend item.
|
IlvSingleHiLoRenderer |
getHiLo(IlvDataSet dataSet)
Returns the child HiLo renderer displaying the specified data set.
|
String |
getLegendText(IlvLegendItem item)
Returns the legend item text.
|
int |
getMode()
Returns the mode of this renderer.
|
String |
getName()
Returns the name of the first child renderer pair.
|
String |
getName(int idx)
Returns the name of the designated child renderer pair.
|
String[] |
getNames()
Returns the list of names of the child renderer pairs.
|
double |
getOverlap()
Returns the overlapping amount.
|
double |
getSpecWidthPercent()
Returns the specified width of the graphical representation of a data
point along the x-axis.
|
int |
getType()
Returns the type of the renderer.
|
double |
getWidth()
Returns the width of the graphical representation of a data point along the
x-axis.
|
double |
getWidthPercent()
Returns the width of the graphical representation of a data point along the
x-axis.
|
boolean |
isUseCategorySpacingAtBorders()
Returns
true if the category spacing is used also at the
left and right borders. |
void |
setMode(int mode)
Sets the mode of this renderer.
|
void |
setName(int idx,
String name)
Sets the name of the designated child renderer pair.
|
void |
setName(String name)
Sets the name of the first child renderer pair.
|
void |
setNames(String[] names)
Sets the list of names of the child renderer pairs.
|
void |
setOverlap(double overlap)
Modifies the overlapping amount.
|
void |
setStyles(IlvStyle[] styles)
Sets the styles used by the child renderers.
|
void |
setType(int type)
Sets the type of the renderer.
|
void |
setUseCategorySpacingAtBorders(boolean useCategorySpacingAtBorders)
Determines whether the category spacing is used also at the left and right
borders.
|
void |
setWidthPercent(double percent)
Sets the width of the graphical representation of a data point along the x-axis.
|
addImageMapAreas, collectDisplayItems, draw, draw, drawAnnotations, drawIntoHitmap, drawSelectionHandles, getAnnotation, getBounds, getBounds, getChild, getChild, getChild, getChildCount, getChildIterator, getChildren, getDisplayItem, getDisplayPoint, getNearestItem, getNearestPoint, getRenderingHint, getRenderingHint, getStyle, getStyles, getXRange, getYRange, getYRange, holdsAnnotations, isViewable, setAnnotation, setAnnotation, setDataPoint, setDisplayPoint, setRenderingHint, setRenderingHint, updateChildren
applyStyles, applyStyles, applyStyles, chartConnected, computeDataLabel, computeDataLabelLocation, create, createRenderer, dispose, drawSelectionHandles, drawSelectionHandles, drawSelectionHandles, endRendererChanges, findAppropriateColor, fireTreemapFocusEvent, getAnnotation, getBounds, getChart, getClipRect, getCoordinateSystem, getDataLabeling, getDataLabelLayout, getDataLabelling, getDataSetIndex, getDataSetMainIndex, getDataSetMainRenderer, getDataSource, getDefaultColors, getDefaultLegendTitle, getDepths, getDisplayItem, getDisplayItems, getLegendStyle, getMinDataSetCount, getNearestItem, getNearestPoint, getParent, getPlotRect, getPreferredMargins, getRenderingHint, getStyle, getVirtualDataSet, getXShift, getYAxisIdx, has3DSupport, isDisplayingDataSet, isVisible, isVisibleInLegend, reDraw, register, set3D, setAnnotation, setDataLabeling, setDataLabelLayout, setDataLabelling, setDataSource, setParent, setRenderingHint, setRenderingHintWithNoDraw, setStyle, setVisible, setVisibleInLegend, setXShift, setYAxisIdx, startRendererChanges, toData, toDisplay, toDisplay, triggerChange
public static final int CLUSTERED
public static final int CANDLE
public static final int OPENCLOSE
public IlvHiLoChartRenderer()
CLUSTERED
BAR
mode, with a default width.public IlvHiLoChartRenderer(int mode, int type, double widthPercent)
mode
- The mode of the renderer. One of the CLUSTERED
,
CANDLE
or OPENCLOSE
constant.type
- The type of the renderer. One of the IlvSingleHiLoRenderer
type. Used only for CLUSTERED
mode.widthPercent
- The width of the renderers.setMode(int)
,
IlvSingleHiLoRenderer
public final int getType()
CLUSTERED
mode.public void setType(int type)
CLUSTERED
mode.public int getMode()
setMode(int)
public void setMode(int mode)
public String[] getNames()
null
.public void setNames(String[] names)
Note: The bean property names
must not be specified together
with the bean property name
.
names
- An array of names, or null
.public String getName(int idx)
idx
- An index.public void setName(int idx, String name)
idx
- An index.name
- A string, used as name for the idx
th child
renderer pair.public String getName()
getName
in class IlvChartRenderer
public void setName(String name)
Note: The bean property name
must not be specified together
with the bean property names
.
setName
in class IlvChartRenderer
public double getOverlap()
CLUSTERED
.setOverlap(double)
public void setOverlap(double overlap)
overlap
parameter can take values between
0
and 100
. It specifies the amount
by which bars overlap.
This method is only meaningful when the mode of the renderer is
set to CLUSTERED
.public double getSpecWidthPercent()
setWidthPercent(double)
public void setWidthPercent(double percent)
setWidthPercent
in interface IlvVariableWidthRenderer
percent
- The new percentage. Valid values are between 0
and 100
.getWidthPercent()
,
getSpecWidthPercent()
public double getWidthPercent()
getWidthPercent
in interface IlvVariableWidthRenderer
setWidthPercent(double)
public double getWidth()
getWidth
in interface IlvVariableWidthRenderer
public boolean isUseCategorySpacingAtBorders()
true
if the category spacing is used also at the
left and right borders.isUseCategorySpacingAtBorders
in interface IlvVariableWidthRenderer
public void setUseCategorySpacingAtBorders(boolean useCategorySpacingAtBorders)
true
, category spacing is not only used
between bars, but also beyond the leftmost and rightmost bars. If set to
false
(the default), this spacing is omitted. This setting
matters only if getWidthPercent
is less than 100.setUseCategorySpacingAtBorders
in interface IlvVariableWidthRenderer
public IlvSingleHiLoRenderer getHiLo(IlvDataSet dataSet)
protected void dataSetsRemoved(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsRemoved
in class IlvChartRenderer
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 IlvChartRenderer
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 dataSetsChangesBatchStarting()
dataSetsChangesBatchStarting
in class IlvChartRenderer
IlvChartRenderer.dataSetsChangesBatchEnding()
protected void dataSetsChangesBatchEnding()
dataSetsChangesBatchEnding
in class IlvChartRenderer
IlvChartRenderer.dataSetsChangesBatchStarting()
protected IlvChartRenderer createChild(IlvDataSet dataSet)
IlvSingleHiLoRenderer
to
display the specified data set.createChild
in class IlvCompositeChartRenderer
dataSet
by the
caller.public void setStyles(IlvStyle[] styles)
setStyles
in class IlvCompositeChartRenderer
IllegalArgumentException
- The array does not contain 2 styles
(fall and rise) per child.public IlvLegendItem[] createLegendItems()
IlvRendererLegendItem
instance for each set of representation.createLegendItems
in class IlvCompositeChartRenderer
null
.IlvLegend
,
IlvLegendItem
,
getLegendText(ilog.views.chart.IlvLegendItem)
public String getLegendText(IlvLegendItem item)
getLegendText
in class IlvCompositeChartRenderer
public void drawLegendSymbol(IlvLegendItem item, Graphics g, int x, int y, int w, int h)
IlvRendererLegendItem
instances to draw the item symbol.drawLegendSymbol
in class IlvCompositeChartRenderer
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.