public class CustomBar extends Series
Title: CustomBar class
Description: Custom Bar Series.
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Modifier and Type | Class and Description |
---|---|
static class |
CustomBar.BarRounding |
static interface |
CustomBar.BarStyleResolver |
static class |
CustomBar.MarksLocation |
Series.MarkTextResolver
Modifier and Type | Field and Description |
---|---|
protected int |
barSizePercent |
protected boolean |
bDark3D |
protected boolean |
bUseOrigin |
protected int |
conePercent |
protected int |
customBarSize |
protected double |
dOrigin |
protected Rectangle |
iBarBounds |
protected int |
iBarSize |
protected MultiBars |
iMultiBar |
protected int |
iNumBars |
protected int |
iOrderPos |
protected int |
iPreviousCount |
protected boolean |
marksOnBar |
protected Color |
normalBarColor |
protected ChartPen |
pPen |
AUTODEPTH, AUTOZORDER, bActive, bBrush, bColorEach, calcVisiblePoints, colorMember, customMarkText, drawBetweenPoints, endZ, firstVisible, hasZValues, iColors, iNumSampleValues, iZOrder, labelMember, lastVisible, listenerList, mandatory, manualData, marks, middleZ, notMandatory, oldDataSource, percentDecimal, percentFormat, sLabels, startZ, useAxis, useSeriesColor, valueFormat, vxValues, vyValues, yMandatory
chart, InternalUse
Constructor and Description |
---|
CustomBar() |
CustomBar(IBaseChart c) |
Modifier and Type | Method and Description |
---|---|
protected int |
applyBarOffset(int position) |
void |
assign(Series source)
Copies all properties from one Series component to another.
Only the common properties shared by both source and destination Series are copied. |
int |
barMargin()
Returns side margin amount in pixels.
|
void |
barRectangle(Color barColor,
int aLeft,
int aTop,
int aRight,
int aBottom)
For internal use.
Displays a Bar or HorizBar point using the parameter coordinates and the BarColor parameter. |
void |
barRectangle(Color barColor,
Rectangle r)
For internal use.
Displays a Bar or HorizBar point using the parameter coordinates and the BarColor parameter. |
void |
barRectangle(Color barColor,
Rectangle r,
int barIndex,
boolean rounded)
For internal use.
Displays a Bar or HorizBar point using the parameter coordinates and the BarColor parameter. |
protected Rectangle |
calcBarBounds(int valueIndex) |
void |
calcFirstLastVisibleIndex() |
protected void |
calcFirstLastVisibleIndex(boolean recursive) |
protected int |
calcMarkLength(int valueIndex) |
void |
calcZOrder() |
int |
clicked(int x,
int y)
Returns the ValueIndex of the "clicked" point in the Series.
Clicked means the X and Y coordinates are in the point screen region bounds. |
void |
createSubGallery(Gallery addSubChart) |
protected void |
doBarGradient(int valueIndex,
Rectangle rect) |
void |
doBeforeDrawChart() |
protected BarStyle |
doGetBarStyle(int valueIndex) |
protected void |
doGradient3D(int valueIndex,
Point p0,
Point p1) |
protected void |
drawLegendShape(IGraphics3D g,
int valueIndex,
Rectangle rect) |
protected void |
drawTickLine(int tickPos,
BarStyle aStyle) |
protected void |
drawTickLines(int startPos,
int endPos,
BarStyle aStyle) |
boolean |
drawValuesForward()
Returns whether Series draws its points in ascending/descending order.
|
boolean |
getAutoMarkPosition()
Repositions Marks on BarSeries to prevent overlapping.
Marks are displaced to the top of the Bars to minimize the overlapping effect of Marks with long text or big font sizes. When false, no checking is performed and all Marks are drawn at their Mark.ArrowLength distance to the top of the Bar. Default value: false |
Rectangle |
getBarBounds()
Coordinates of current Bar point being displayed.
Run-time and read-only. |
protected int |
getBarBoundsMidX() |
CustomBar.BarRounding |
getBarRound()
Describes what ends of the Bar are rounded.
Used only when BarStyle property is RoundRectangle |
int |
getBarSizePercent() |
BarStyle |
getBarStyle()
Defines the Bar shape used to draw Bars.
Default value: BarStyle.Rectangle |
ChartBrush |
getBrush()
Defines the Brush used to fill Bars.
When BarBrush.Style is different than bsSolid, the Series.Color color is the background bar color. |
int |
getConePercent()
The apex size as percentage of the base.
Default value: 0 |
int |
getCustomBarWidth() |
boolean |
getDark3D()
Darkens sides of bars to enhance 3D effect.
This has effect only when Chart.Aspect.View3D is true. |
int |
getDepthPercent()
Determines the percent amount of bar size in "z" depth direction.
|
Gradient |
getGradient()
Defines the color Gradient used to fill the Bars.
These can be filled with these three colors: StartColor, MidColor, EndColor. |
boolean |
getGradientRelative()
Calculates Colors based on highest bar when Gradient is Visible.
Default value: false |
CustomBar.MarksLocation |
getMarksLocation() |
boolean |
getMarksOnBar() |
MultiBars |
getMultiBar()
Determines how multiple BarSeries will be displayed in the same Chart.
If you have more than one Bar series in the same Chart, then you can choose if they will be drawn side-by-side, back-to-front or Stacked. Side-by-side means the Bar width will be divided by the number of Bar Series. |
int |
getOffsetPercent()
The Bar displacement as percentage of Bar size.
Displacement is horizontal for Bar series and vertical for HorizBar series. |
double |
getOrigin()
The common bottom value used for all Bar points.
UseOrigin must be true (the default) to use the Origin property. |
ChartPen |
getPen()
Pen used to draw the Bar rectangles.
You can set BarPen.Visible = false to hide these lines. |
int |
getRoundSize()
Amount in pixels of the bar end rounding.
Used only when BarStyle property is RoundRectangle |
boolean |
getSideMargins()
Margin between Chart rectangle and Bars.
Default value: true |
int |
getStackGroup()
Allows stacking independent Series within the same Chart, in series
groups.
Default value: 0 |
ChartPen |
getTickLines()
Pen used to draw "tick" lines across each bar.
|
boolean |
getUseOrigin()
Bars to be bottom aligned at the Origin method value.
|
double |
getYOrigin()
Obsolete. Please use CustomBar.Origin instead.
|
protected void |
internalApplyBarMargin(Margins margins) |
protected int |
internalCalcMarkLength(int valueIndex) |
protected boolean |
internalClicked(int valueIndex,
Point point) |
protected int |
internalGetOriginPos(int valueIndex,
int defaultOrigin) |
protected boolean |
isPointInChartRect(int valueIndex) |
protected int |
lastVisibleMark() |
protected double |
maxMandatoryValue(double value) |
protected double |
minMandatoryValue(double value) |
protected int |
numSampleValues() |
double |
pointOrigin(int valueIndex,
boolean sumAll)
For Internal Use.
The PointOrigin function returns the summed values of more than one Series point. It's only used by Series types with Stacked or Stacked 100% styles such as BarSeries, HorizBar series and Area series. |
void |
prepareForGallery(boolean isEnabled) |
void |
removeBarStyleResolver() |
void |
setAutoMarkPosition(boolean value)
Repositions Marks on BarSeries to prevent overlapping.
Default value: false |
void |
setBarRound(CustomBar.BarRounding value)
Describes what ends of the Bar are rounded.
Used only when BarStyle property is RoundRectangle |
protected void |
setBarSizePercent(int value) |
void |
setBarStyle(BarStyle value)
Defines the Bar shape used to draw Bars.
Default value: BarStyle.Rectangle |
void |
setBarStyleResolver(CustomBar.BarStyleResolver resolver) |
void |
setChart(IBaseChart c)
Chart associated with this object.
|
void |
setConePercent(int value)
Sets the apex size as a percentage of the base.
Default value: 0 |
void |
setCustomBarWidth(int value) |
void |
setDark3D(boolean value)
Darkens sides of bars to enhance 3D effect.
Default value: true |
void |
setDepthPercent(int value)
Determines the percent amount of bar size in "z" depth direction.
|
void |
setGradientRelative(boolean value)
Calculates Colors based on highest bar when Gradient is Visible.
Default value: false |
void |
setMarksLocation(CustomBar.MarksLocation value) |
void |
setMarksOnBar(boolean value) |
void |
setMultiBar(MultiBars value)
Determines how multiple BarSeries will be displayed in the same Chart.
Default value: MultiBars.Side |
void |
setOffsetPercent(int value)
Sets the Bar displacement as percentage of Bar size.
Default value: 0 |
void |
setOrigin(double value)
Sets the common bottom value used for all Bar points.
Default value: 0 |
protected void |
setPenBrushBar(Color barColor) |
void |
setRoundSize(int value)
Amount in pixels of the bar end rounding.
Used only when BarStyle property is RoundRectangle |
void |
setSideMargins(boolean value)
Sets a margin between Chart rectangle and Bars.
Default value: true |
void |
setStackGroup(int value)
Allows stacking independent Series within the same Chart, in series
groups.
Default value: 0 |
void |
setSubGallery(int index)
Creates and prepares the index'th Series style to show at sub-gallery
dialog.
|
void |
setUseOrigin(boolean value)
Allows Bars to be bottom aligned at the Origin method value.
|
void |
setYOrigin(double value)
Obsolete. Please use CustomBar.Origin instead.
|
void |
setZPositions() |
protected boolean |
shouldSerializeYOrigin() |
protected int[] |
sortDrawSeries(int firstSeries,
int lastSeries,
int valueIndex) |
protected boolean |
subGalleryStack() |
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addChartValue, added, addedValue, addNull, addNullXY, addSampleValues, addSeriesMouseListener, addSeriesPaintListener, addValues, assignDispose, assignValues, associatedToAxis, beginUpdate, calcHorizMargins, calcPercentSt, calcPosValue, calculateMarkPosition, calcVerticalMargins, calcXPos, calcXPosValue, calcXSizeValue, calcYPos, calcYPosValue, calcYSizeValue, canAddRandomPoints, changeType, checkDataSource, checkMouse, checkOrder, checkOtherSeries, clear, clearLists, clicked, clone, cloneSeries, convertArray, countLegendItems, createNewSeries, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doAfterDrawValues, doBeforeDrawValues, doClick, doClickPointer, doDoubleClick, draw, drawHiddenValue, drawLegend, drawLegend, drawMark, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValue, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, galleryChanged3D, getActive, getAllowSinglePoint, getBitmapEditor, getColor, getColorEach, getColorMember, getColors, getCount, getCountLegendItems, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getDescription, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getLegendString, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxXValue, getMaxYValue, getMaxZValue, getMiddleZ, getMinXValue, getMinYValue, getMinZValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getPoint, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueColor, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasColors, hasDataSource, hasLabels, hasListenersOf, hasNoMandatoryValues, isNull, isValidSeriesSource, isValidSourceOf, lastDisplayed, legendItemColor, legendToValueIndex, maxMarkWidth, moreSameZOrder, mouseEvent, newFromType, onDisposing, prepareLegendCanvas, randomBounds, readResolve, recalcGetAxis, refreshSeries, removeMarkTextResolver, removeSeriesMouseListener, removeSeriesPaintListener, repaint, sameClass, setActive, setColor, setColorEach, setColorMember, setColors, setCursor, setCustomHorizAxis, setCustomHorizAxis, setCustomVertAxis, setCustomVertAxis, setDataSource, setDefaultNullValue, setDepth, setEndZ, setFunction, setHorizontal, setHorizontalAxis, setLabelMember, setLabels, setMarks, setMarkTextResolver, setMiddleZ, setNull, setNull, setPercentFormat, setSeriesColor, setShowInLegend, setStartZ, setTitle, setValueFormat, setValueList, setVerticalAxis, setVisible, setXValues, setYValues, setZOrder, sortByLabels, sortByLabels, swapValueIndex, titleOrName, toString, valueListOfAxis, valuesListAdd, xScreenToValue, yScreenToValue
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChart, invalidate
protected int barSizePercent
protected int conePercent
protected boolean bDark3D
protected MultiBars iMultiBar
protected boolean bUseOrigin
protected boolean marksOnBar
protected double dOrigin
protected ChartPen pPen
protected Rectangle iBarBounds
protected int iNumBars
protected int iOrderPos
protected int iPreviousCount
protected int iBarSize
protected int customBarSize
protected Color normalBarColor
public CustomBar(IBaseChart c)
public CustomBar()
public void setBarStyleResolver(CustomBar.BarStyleResolver resolver)
public void removeBarStyleResolver()
public boolean getMarksOnBar()
public void setMarksOnBar(boolean value)
public CustomBar.MarksLocation getMarksLocation()
public void setMarksLocation(CustomBar.MarksLocation value)
public void assign(Series source)
Series
public Gradient getGradient()
Example:
barSeries = new Bar(myChart.getChart()); barSeries.getMarks().setVisible(true); barSeries.fillSampleValues(6); barSeries.setColor(Color.RED); barSeries.setBarStyle(BarStyle.RECTGRADIENT); barSeries.getGradient().setDirection(GradientDirection.VERTICAL); barSeries.getGradient().setStartColor(Color.GREEN); barSeries.getGradient().setUseMiddle(false); barSeries.getGradient().setMiddleColor(Color.YELLOW);
public boolean getGradientRelative()
public void setGradientRelative(boolean value)
value
- booleanpublic int getStackGroup()
public void setStackGroup(int value)
Example:
bar1Series.setStackGroup(0); bar2Series.setStackGroup(1);
value
- intpublic void setZPositions()
setZPositions
in class Series
public int getDepthPercent()
public void setDepthPercent(int value)
Example:
series.setDepthPercent(50) ; // % of 3D depth
value
- intpublic boolean getDark3D()
public void setDark3D(boolean value)
value
- booleanpublic void prepareForGallery(boolean isEnabled)
prepareForGallery
in class Series
protected void setBarSizePercent(int value)
public int getBarSizePercent()
public boolean getSideMargins()
public void setSideMargins(boolean value)
value
- booleanprotected boolean shouldSerializeYOrigin()
public double getYOrigin()
public void setYOrigin(double value)
value
- doublepublic boolean getUseOrigin()
public void setUseOrigin(boolean value)
value
- booleanpublic double getOrigin()
public void setOrigin(double value)
value
- doublepublic boolean getAutoMarkPosition()
public void setAutoMarkPosition(boolean value)
value
- booleanpublic int getConePercent()
public void setConePercent(int value)
value
- intpublic int getOffsetPercent()
public void setOffsetPercent(int value)
value
- intpublic BarStyle getBarStyle()
public void setBarStyle(BarStyle value)
value
- BarStylepublic int getRoundSize()
public void setRoundSize(int value)
value
- intpublic CustomBar.BarRounding getBarRound()
public void setBarRound(CustomBar.BarRounding value)
value
- BarRoundingpublic ChartBrush getBrush()
public void setChart(IBaseChart c)
TeeBase
public MultiBars getMultiBar()
public void setMultiBar(MultiBars value)
value
- MultiBarspublic ChartPen getPen()
public ChartPen getTickLines()
public Rectangle getBarBounds()
protected int getBarBoundsMidX()
protected BarStyle doGetBarStyle(int valueIndex)
protected int internalCalcMarkLength(int valueIndex)
public void barRectangle(Color barColor, Rectangle r)
barColor
- Colorr
- Rectanglepublic void barRectangle(Color barColor, int aLeft, int aTop, int aRight, int aBottom)
barColor
- ColoraLeft
- intaTop
- intaRight
- intaBottom
- intpublic void barRectangle(Color barColor, Rectangle r, int barIndex, boolean rounded)
barColor
- Colorr
- RectanglebarIndex
- introunded
- booleanprotected void doBarGradient(int valueIndex, Rectangle rect)
public int getCustomBarWidth()
public void setCustomBarWidth(int value)
public int barMargin()
protected void internalApplyBarMargin(Margins margins)
protected Rectangle calcBarBounds(int valueIndex)
protected boolean isPointInChartRect(int valueIndex)
isPointInChartRect
in class Series
protected void calcFirstLastVisibleIndex(boolean recursive)
public void calcFirstLastVisibleIndex()
calcFirstLastVisibleIndex
in interface ISeries
calcFirstLastVisibleIndex
in class Series
protected int lastVisibleMark()
lastVisibleMark
in class Series
protected int internalGetOriginPos(int valueIndex, int defaultOrigin)
protected double maxMandatoryValue(double value)
public double pointOrigin(int valueIndex, boolean sumAll)
valueIndex
- intsumAll
- booleanprotected double minMandatoryValue(double value)
public void calcZOrder()
calcZOrder
in class Series
protected int[] sortDrawSeries(int firstSeries, int lastSeries, int valueIndex)
sortDrawSeries
in class Series
public void doBeforeDrawChart()
doBeforeDrawChart
in class Series
protected void drawTickLine(int tickPos, BarStyle aStyle)
protected void drawTickLines(int startPos, int endPos, BarStyle aStyle)
protected void drawLegendShape(IGraphics3D g, int valueIndex, Rectangle rect)
drawLegendShape
in class Series
public boolean drawValuesForward()
Series
drawValuesForward
in class Series
protected int applyBarOffset(int position)
protected int calcMarkLength(int valueIndex)
protected boolean internalClicked(int valueIndex, Point point)
public int clicked(int x, int y)
protected int numSampleValues()
numSampleValues
in class Series
protected void setPenBrushBar(Color barColor)
protected boolean subGalleryStack()
public void createSubGallery(Gallery addSubChart)
createSubGallery
in class Series
public void setSubGallery(int index)
Series
setSubGallery
in interface ISeries
setSubGallery
in class Series
index
- int