public class IlvBarChartRenderer extends IlvSimpleCompositeChartRenderer implements IlvVariableWidthRenderer, IlvSuperimposedRenderer
IlvSingleBarRenderer
for
every data set in the connected data source. An IlvBarChartRenderer
supports three representation modes:
SUPERIMPOSED
constant.CLUSTERED
constant.STACKED
constant.
Modifier and Type | Field and Description |
---|---|
static int |
CLUSTERED
Mode type for clustered bars.
|
static int |
STACKED
Mode type for stacked bars.
|
static int |
SUPERIMPOSED
Mode type for superimposed bars.
|
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
DEFAULT_WIDTH
Constructor and Description |
---|
IlvBarChartRenderer()
Creates a new
IlvBarChartRenderer ,
with a default bar width and the CLUSTERED mode. |
IlvBarChartRenderer(double barWidth,
int mode)
Creates a new
IlvBarChartRenderer ,
with the specified bar width and mode. |
IlvBarChartRenderer(int mode)
Creates a new
IlvBarChartRenderer ,
with a default bar width and specified mode. |
Modifier and Type | Method and Description |
---|---|
protected IlvChartRenderer |
createChild(IlvDataSet dataSet)
Creates an instance of
IlvSingleBarRenderer to
display the specified data set. |
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.
|
IlvSingleBarRenderer |
getBar(IlvDataSet dataSet)
Returns the child bar renderer displaying the specified data set.
|
int |
getBarShape()
Returns the shape of the bars.
|
double |
getClusterWidth()
Returns the cluster width.
|
int |
getMode()
Returns the mode of this renderer.
|
double |
getOverlap()
Returns the overlapping amount.
|
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.
|
boolean |
has3DSupport()
Indicates whether this renderer supports three-dimensional drawing.
|
boolean |
isAutoTransparency()
Returns whether this renderer should use transparent default colors.
|
boolean |
isDiverging()
Returns true if negative values are stacked separately from positive
values.
|
boolean |
isStacked100Percent()
Indicates whether the stacking is scaled to
100 . |
boolean |
isStackedByIndex()
Indicates whether the stacking is based on data set indices rather than
on X values.
|
boolean |
isSuperimposed()
Returns whether this renderer is in a superimposed configuration.
|
boolean |
isUseCategorySpacingAtBorders()
Returns
true if the category spacing is used also at the
left and right borders. |
void |
setAutoTransparency(boolean transparent)
Sets whether this renderer should use transparent default colors.
|
void |
setBarShape(int barShape)
Sets the shape of the bars.
|
void |
setClusterWidth(double width)
Modifies the cluster width.
|
void |
setDiverging(boolean diverging)
Specifies whether negative values are stacked separately from positive
values.
|
void |
setMode(int mode)
Sets the mode of this renderer.
|
void |
setOverlap(double overlap)
Modifies the overlapping amount.
|
void |
setStacked100Percent(boolean stacked100)
Specifies the stacking mode.
|
void |
setStackedByIndex(boolean stackedByIndex)
Specifies whether the stacking is based on data set indices rather than
on X values.
|
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.
|
protected void |
updateChildren()
Updates the layout of the child bars.
|
addImageMapAreas, collectDisplayItems, createLegendItems, draw, draw, drawAnnotations, drawIntoHitmap, drawLegendSymbol, drawSelectionHandles, getAnnotation, getBounds, getBounds, getChild, getChild, getChild, getChildCount, getChildIterator, getChildren, getDisplayItem, getDisplayPoint, getLegendText, getNearestItem, getNearestPoint, getRenderingHint, getRenderingHint, getStyle, getStyles, getXRange, getYRange, getYRange, holdsAnnotations, isViewable, setAnnotation, setAnnotation, setDataPoint, setDisplayPoint, setRenderingHint, setRenderingHint, setStyles
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, getName, getNearestItem, getNearestPoint, getParent, getPlotRect, getPreferredMargins, getRenderingHint, getStyle, getVirtualDataSet, getXShift, getYAxisIdx, isDisplayingDataSet, isVisible, isVisibleInLegend, reDraw, register, set3D, setAnnotation, setDataLabeling, setDataLabelLayout, setDataLabelling, setDataSource, setName, setParent, setRenderingHint, setRenderingHintWithNoDraw, setStyle, setVisible, setVisibleInLegend, setXShift, setYAxisIdx, startRendererChanges, toData, toDisplay, toDisplay, triggerChange
public static final int SUPERIMPOSED
setMode(int)
,
Constant Field Valuespublic static final int CLUSTERED
public static final int STACKED
Two stacking modes are available:
setStacked100Percent(boolean)
method.public IlvBarChartRenderer()
IlvBarChartRenderer
,
with a default bar width and the CLUSTERED
mode.public IlvBarChartRenderer(int mode)
IlvBarChartRenderer
,
with a default bar width and specified mode.public IlvBarChartRenderer(double barWidth, int mode)
IlvBarChartRenderer
,
with the specified bar width and mode.
The bar width will be used to create the child bars. Each bar can be
accessed and customized with the getBar(IlvDataSet)
method.
Note that if the mode of the renderer is SUPERIMPOSED
,
bar widths are computed automatically.setMode(int)
public final int getMode()
setMode(int)
public void setMode(int mode)
SUPERIMPOSED
,
STACKED
,
CLUSTERED
public boolean has3DSupport()
has3DSupport
in interface IlvChart3DSupport
has3DSupport
in class IlvChartRenderer
true
public boolean isStacked100Percent()
100
.
This method is meaningful only when the mode of the renderer is
set to STACKED
.setStacked100Percent(boolean)
,
setMode(int)
public void setStacked100Percent(boolean stacked100)
stacked100
is set to true
, the sum of all the y-values
for a given x-value is scaled to 100. Each bar represents the
percentage it contributes to this sum.
This method is meaningful only when the mode of the renderer is
set to STACKED
.stacked100
- The new stacking mode.isStacked100Percent()
,
setMode(int)
public boolean isStackedByIndex()
STACKED
.setStackedByIndex(boolean)
,
setMode(int)
public void setStackedByIndex(boolean stackedByIndex)
stackedByIndex
is set to true
, the Y values
are computed by accumulating the Y values with the same index, regardless
of their X values, and the X values of the second, third, etc. data sets
are ignored.
If stackedByIndex
is set to false
, the Y values
are computed by accumulating the Y values with the same X value,
regardless of their index in the data set.
This method is meaningful only when the mode of the renderer is
set to STACKED
.isStackedByIndex()
,
setMode(int)
public boolean isDiverging()
STACKED
.setDiverging(boolean)
public void setDiverging(boolean diverging)
STACKED
.
If diverging is set to true
, positive
y values will be stacked together in a bar towards positive values, and
negative y values will be stacked together in a bar in the opposite
direction. This rendering mode makes it easy to visually understand
negative values.
Warning: This mode assumes that there is no particular order among the data sets; the data points belonging to negative y values are reordered, as if they all came before the positive y values.
Warning: Also, in this mode, the largest displayed y value is no longer the sum of all y values; rather, it is the sum of all positive y values. This can be confusing for the user.
Note: In this release, this mode has no effect when the
stackedByIndex
property is set to true
or when
the stacked100Percent
property is set to true
.
isDiverging()
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 meaningful only when the mode of the renderer is
set to CLUSTERED
.public final double getClusterWidth()
CLUSTERED
.setClusterWidth(double)
public final void setClusterWidth(double width)
CLUSTERED
.public double getWidthPercent()
getWidthPercent
in interface IlvVariableWidthRenderer
IlvVariableWidthRenderer.setWidthPercent(double)
public void setWidthPercent(double percent)
setWidthPercent
in interface IlvVariableWidthRenderer
percent
- The new percentage. Valid values are between 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 int getBarShape()
setBarShape(int)
public void setBarShape(int barShape)
barShape
- One of IlvSingleBarRenderer.SHAPE_QUADRILATERAL
,
IlvSingleBarRenderer.SHAPE_POLYGON
,
IlvSingleBarRenderer.SHAPE_EXACT
.getBarShape()
protected void updateChildren()
updateChildren
in class IlvCompositeChartRenderer
protected void dataSetsAdded(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsAdded
in class IlvSimpleCompositeChartRenderer
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.IlvCompositeChartRenderer.createChild(ilog.views.chart.data.IlvDataSet)
protected void dataSetsRemoved(int firstIdx, int lastIdx, IlvDataSet[] oldDataSets)
dataSetsRemoved
in class IlvSimpleCompositeChartRenderer
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.IlvChartRenderer.isViewable()
protected void dataSetsChangesBatchStarting()
dataSetsChangesBatchStarting
in class IlvChartRenderer
IlvChartRenderer.dataSetsChangesBatchEnding()
protected void dataSetsChangesBatchEnding()
dataSetsChangesBatchEnding
in class IlvChartRenderer
IlvChartRenderer.dataSetsChangesBatchStarting()
public IlvSingleBarRenderer getBar(IlvDataSet dataSet)
protected IlvChartRenderer createChild(IlvDataSet dataSet)
IlvSingleBarRenderer
to
display the specified data set.createChild
in class IlvCompositeChartRenderer
dataSet
by the
caller.public boolean isAutoTransparency()
isAutoTransparency
in interface IlvSuperimposedRenderer
public void setAutoTransparency(boolean transparent)
setAutoTransparency
in interface IlvSuperimposedRenderer
public boolean isSuperimposed()
isSuperimposed
in interface IlvSuperimposedRenderer
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.