public class IlvSingleHiLoRenderer extends IlvSingleChartRenderer implements IlvVariableWidthRenderer
For every point index, a point is taken from the first data set in the data source, and a point is taken from the second data set in the data source, to form a pair of points. The pairs of points are also called "high/low" items.
This renderer is used in three situations:
IlvHiLoRenderer
in CLUSTERED
mode.
In this case, the pair consists of a "first point" and of a "second
point".IlvHiLoRenderer
in CANDLE
or
OPENCLOSE
mode, for the high-low values. In this case,
the pair consists of a "low value" and of a "high value". The low
value comes first.IlvHiLoRenderer
in CANDLE
or
OPENCLOSE
mode, for the open-close values. In this case,
the pair consists of an "open" (or "start") value and of a "close"
(or "end") value.
An IlvSingleHiLoRenderer
can be of 4 types: BAR, ARROW, MARKED and STICK. The only difference
among these modes is the way the renderer is drawn.
The following figure shows the different types:
This renderer uses two rendering styles to draw the data points:
Modifier and Type | Field and Description |
---|---|
static int |
ARROW
Arrow renderer type.
|
static int |
BAR
Bar renderer type.
|
static int |
MARKED
Marked renderer type.
|
static int |
STICK
Stick renderer type.
|
AREA, 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
DEFAULT_WIDTH
Constructor and Description |
---|
IlvSingleHiLoRenderer()
Creates a new HiLo renderer.
|
IlvSingleHiLoRenderer(IlvStyle riseStyle,
IlvStyle fallStyle)
Creates a new HiLo renderer, using the specified styles.
|
IlvSingleHiLoRenderer(IlvStyle riseStyle,
IlvStyle fallStyle,
int type,
double widthPercent)
Creates a new HiLo renderer, using the specified styles, type, and width.
|
Modifier and Type | Method and Description |
---|---|
void |
applyStyles(boolean newStyles)
Applies styling to the renderer.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the renderer is added to or removed from a chart.
|
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 given legend item.
|
Rectangle2D |
getBounds(IlvDataSet dataSet,
int iMin,
int iMax,
Rectangle2D bounds)
Returns the bounds of the graphical representation for the
specified data.
|
Rectangle2D |
getBounds(IlvDataSet dataSet,
int iMin,
int iMax,
Rectangle2D bounds,
boolean includeAnnotations)
Returns the bounds of the graphical representation for the specified data.
|
IlvStyle |
getFallStyle()
Returns the fall style.
|
int |
getMinDataSetCount()
Returns the minimum number of required data sets.
|
IlvStyle |
getRiseStyle()
Returns the rise style.
|
static int |
getStrokeThreshold()
Returns the minimum width of an HiLo item, under which the stroke of a
rendering style is not used.
|
IlvStyle[] |
getStyles()
Returns the styles used by this renderer.
|
int |
getType()
Returns the type of this 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 |
isFilled()
Indicates whether the renderer uses a fill color.
|
boolean |
isUseCategorySpacingAtBorders()
Returns
true if the category spacing is used also at the
left and right borders. |
void |
setFallStyle(IlvStyle r)
Sets the fall style.
|
void |
setRiseStyle(IlvStyle r)
Sets the rise style.
|
static void |
setStrokeThreshold(int threshold)
Specifies the minimum width of an HiLo item, under which the stroke of a
rendering style is not used.
|
void |
setStyles(IlvStyle[] styles)
Sets the styles used by the child renderers.
|
void |
setType(int type)
Sets the type of this 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, applyDataSetStyle, createLegendItems, dataSetContentsChanged, dataSetPropertyChanged, draw, draw, drawAnnotations, drawIntoHitmap, drawSelectionHandles, drawSelectionHandles, getAnnotation, getBounds, getDefaultLegendText, getDisplayItem, getDisplayPoint, getDisplayStyle, getLegendText, getNearestItem, getNearestPoint, getPreferredMargins, getRenderingHint, getRenderingHint, getStyle, getStyle, getXRange, getYRange, getYRange, getZAnnotationText, holdsAnnotations, makeDefaultStyle, set3D, setAnnotation, setAnnotation, setDataPoint, setDisplayPoint, setRenderingHint, setRenderingHint, setStyle, toDisplay, toDisplay
applyStyles, applyStyles, collectDisplayItems, computeDataLabel, computeDataLabelLocation, create, createRenderer, dataSetsChangesBatchEnding, dataSetsChangesBatchStarting, dispose, drawSelectionHandles, drawSelectionHandles, endRendererChanges, findAppropriateColor, fireTreemapFocusEvent, getAnnotation, getChart, getChild, getChildCount, getChildIterator, getChildren, getClipRect, getCoordinateSystem, getDataLabeling, getDataLabelLayout, getDataLabelling, getDataSetIndex, getDataSetMainIndex, getDataSetMainRenderer, getDataSource, getDefaultColors, getDefaultLegendTitle, getDepths, getDisplayItem, getDisplayItems, getLegendStyle, getName, getNearestItem, getNearestPoint, getParent, getPlotRect, getRenderingHint, getStyle, getVirtualDataSet, getXShift, getYAxisIdx, has3DSupport, 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 STICK
public static final int BAR
public static final int ARROW
public static final int MARKED
public IlvSingleHiLoRenderer()
public IlvSingleHiLoRenderer(IlvStyle riseStyle, IlvStyle fallStyle)
public static int getStrokeThreshold()
setStrokeThreshold(int)
public static void setStrokeThreshold(int threshold)
The default value is 6
.
threshold
- The new threshold in pixel. Filled HiLo items with a
width smaller than this threshold will not be rendered with a stroke.getStrokeThreshold()
public int getMinDataSetCount()
2
.getMinDataSetCount
in class IlvChartRenderer
public boolean isFilled()
isFilled
in class IlvSingleChartRenderer
true
for the BAR
and types
,
false
otherwise.getType()
public IlvStyle getRiseStyle()
public void setRiseStyle(IlvStyle r)
Note: The Bean property riseStyle
must not be specified together
with the Bean property style
.
public IlvStyle getFallStyle()
public void setFallStyle(IlvStyle r)
public IlvStyle[] getStyles()
getStyles
in class IlvSingleChartRenderer
IlvSingleChartRenderer.getStyle()
public void setStyles(IlvStyle[] styles)
IlvSingleHiLoRenderer
assumes that the given array contains
the rise style at index 0
and the fall style at index 1
. If
this is not the case, the first array item is set as both the fall and rise style.setStyles
in class IlvSingleChartRenderer
Note: The Bean property styles
must not be specified
together with the Bean property style
.
public void applyStyles(boolean newStyles) throws Exception
applyStyles
in class IlvSingleChartRenderer
Exception
public double getWidthPercent()
getWidthPercent
in interface IlvVariableWidthRenderer
setWidthPercent(double)
public void setWidthPercent(double percent)
setWidthPercent
in interface IlvVariableWidthRenderer
percent
- The new percentage. Valid values are within 0 and 100.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 final int getType()
public void setType(int type)
ChartRendererEvent.STYLE_CHANGED
event.STICK
,
BAR
,
MARKED
,
ARROW
,
IlvChartRenderer.triggerChange(int)
public Rectangle2D getBounds(IlvDataSet dataSet, int iMin, int iMax, Rectangle2D bounds)
null
, a new
Rectangle2D
is allocated.
Note that the bounds may be larger than necessary. There is no guarantee that the bounds returned are tight.
Note about multi-threading: This method must not take the Swing
tree lock, and must not access IlvChart
API that is
not multithread-safe.
getBounds
in class IlvChartRenderer
dataSet
- The data set containing the data points.iMin
- The minimum data point index.iMax
- The maximum data point index.bounds
- An optional rectangle used to store the result.public Rectangle2D getBounds(IlvDataSet dataSet, int iMin, int iMax, Rectangle2D bounds, boolean includeAnnotations)
null
, a new
Rectangle2D
is allocated.
Note that the bounds may be larger than necessary. There is no guarantee that the bounds returned are tight.
Note about multi-threading: This method must not take the Swing tree lock,
and must not access IlvChart
API that is not multithread-safe.
getBounds
in class IlvSingleChartRenderer
dataSet
- The data set containing the data points.iMin
- The minimum data point index.iMax
- The maximum data point index.bounds
- An optional rectangle used to store the result.includeAnnotations
- Indicates whether annotation bounds should be included.protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected
in class IlvSingleChartRenderer
oldChart
- The chart with which this renderer was associated. This parameter is
null
if this renderer is added to a new chart.newChart
- The chart to which this renderer is added. This parameter is
null
if this renderer is removed from its current chart.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 void drawLegendSymbol(IlvLegendItem item, Graphics g, int x, int y, int w, int h)
IlvRendererLegendItem
instances to draw the item symbol.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.