Summ:  Constr. Methods    Details:  Constr. Methods      Class:  Prev Next
com.artfulbits.aiCharts.Base
Class ChartType

java.lang.Object com.artfulbits.aiCharts.Base.ChartType

Declaration: public abstract class ChartType extends Object
Direct Subclasses: ChartAreaType, ChartBubbleType, ChartCandleStickType, ChartColumnType, ChartFastLineType, ChartFunnelType, ChartHiLoOpenCloseType, ChartHiLoType, ChartLineType, ChartPieType, ChartPyramidType, ChartRangeColumnType, ChartSplineType, ChartStackedAreaType, ChartStackedColumnType, ChartStepAreaType, ChartStepLineType

 

Represents base class for all chart types.

 

Since: 1.0

 

 

Constructors Summary
ChartType()
    

 

 

Methods Summary
boolean colorPerPoint()
    
Indicated whether this chart type requires separate color for each point it draws.
static DoubleRange computeXRange(ChartType type, ChartSeries series)
    
Calculates range consumed by specified chart type that represents specified series.
static DoubleRange computeYRange(ChartType type, ChartSeries series, int[] yIndices)
    
Calculates range consumed by specified chart type that represents specified series.
abstract void draw(ChartRenderArgs args)
    
Draws this chart type on surface specified along.
void drawIcon(Graphics g, XYRect rect, ChartPointAttributes point)
    
Draws icon that corresponds to this chart type.
void drawMarkers(ChartRenderArgs args)
    
Iterates over points collection for this chart type and draws marker for each point that requires it.
int getRequiredCoordinateSystem()
    
Gets value indicating coordinate system that this chart type requires to be shown.
DoubleRange getXRange(ChartSeries series)
    
Gets range that this chart type will consume having specified series.
DoubleRange getYRange(ChartSeries series)
    
Gets range that this chart type will consume having specified series.
boolean isCompatible(ChartType type)
    
Determines whether this chart type can be shown along with passed type on area.
static boolean isCompatible(ChartType type1, ChartType type2)
    
Determines whether two chart types are compatible.
boolean isOriginDependent()
    
Indicates whether this type depends on axis origin value.
boolean isRotated()
    
Indicates whether this type requires X and Y axes swapping.
boolean isSideBySide()
    
Indicated whether this chart type is placed side by side.
boolean isStacked()
    
Indicates whether it type is stacked.
boolean isStacked100()
    
Indicated whether this type is stacked to percentage relationship.

 

Methods inherited from class: java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

 

 

 

ChartType

 

public ChartType( )

 

 

 

 

isSideBySide

 

public boolean isSideBySide( )

 

Indicated whether this chart type is placed side by side. Typical side-by-side chart type is ChartColumnType.

 

Returns:
true if chart type is side by side, otherwise false.

 

Since: 1.0

 

 

 

isStacked

 

public boolean isStacked( )

 

Indicates whether it type is stacked. Stacked charts show the relationship of parts to the whole. Stacked charts offer similar complexity to clustered series by adding together component value items within or area.

 

Returns:
true if this type is stacked, otherwise false.

 

Since: 1.0

 

 

 

isStacked100

 

public boolean isStacked100( )

 

Indicated whether this type is stacked to percentage relationship. Series are stacked on top of each other, adding up to 100%. Each series' segment represents the percentage that the value contributes to the sum of the values for that category.

 

Returns:
true is this chart type is 100% stacked, otherwise false.

 

Since: 1.0

 

 

 

isOriginDependent

 

public boolean isOriginDependent( )

 

Indicates whether this type depends on axis origin value.

 

Returns:
true if chart type consumes value of origin to draw, otherwise false.

 

Since: 1.0

 

 

 

isRotated

 

public boolean isRotated( )

 

Indicates whether this type requires X and Y axes swapping.

 

Returns:
true if this chart type is rotated, otherwise false.

 

Since: 1.0

 

 

 

colorPerPoint

 

public boolean colorPerPoint( )

 

Indicated whether this chart type requires separate color for each point it draws.

 

Returns:
true if this chart type requires color for each point, otherwise false.

 

Since: 1.0

 

 

 

getRequiredCoordinateSystem

 

public int getRequiredCoordinateSystem( )

 

Gets value indicating coordinate system that this chart type requires to be shown. Default implementation assumes CoordinateSystem.CARTESIAN.

 

Returns:
instance of CoordinateSystem enumeration.

 

Since: 1.0

 

 

 

isCompatible

 

public boolean isCompatible( ChartType type)

 

Determines whether this chart type can be shown along with passed type on area.

 

Parameters:
type-
instance of ChartType that should be checked for compatibility.
Returns:
true if specified chart type is compatible wich current.

 

Since: 1.0

 

 

 

getXRange

 

public DoubleRange getXRange( ChartSeries series)

 

Gets range that this chart type will consume having specified series.

 

Parameters:
series-
instance of ChartSeries class.
Returns:
instance of DoubleRange class that represents required X range.

 

Since: 1.0
See also: getYRange(ChartSeries)

 

 

 

getYRange

 

public DoubleRange getYRange( ChartSeries series)

 

Gets range that this chart type will consume having specified series.

 

Parameters:
series-
instance of ChartSeries class.
Returns:
instance of DoubleRange class that represents required Y range.

 

Since: 1.0
See also: getXRange(ChartSeries)

 

 

 

computeXRange

 

public static DoubleRange computeXRange( ChartType type,
ChartSeries series)

 

Calculates range consumed by specified chart type that represents specified series.

 

Parameters:
type-
instance of consuming type.
series-
instance of represented ChartSeries class.
Returns:
instance of DoubleRange representing consumed range.

 

Since: 1.0

 

 

 

computeYRange

 

public static DoubleRange computeYRange( ChartType type,
ChartSeries series,
int[] yIndices)

 

Calculates range consumed by specified chart type that represents specified series.

 

Parameters:
type-
instance of consuming type.
series-
series instance of represented ChartSeries class.
yIndices-
array of values representing zero-based positions of Y values from series' points collection.
Returns:
instance of DoubleRange representing consumed range.

 

Since: 1.0

 

 

 

isCompatible

 

public static boolean isCompatible( ChartType type1,
ChartType type2)

 

Determines whether two chart types are compatible.

 

Parameters:
type1-
instance of first type.
type2-
instance of second type.
Returns:
true if specified chart types are compatible and can be shown on area together.

 

Since: 1.0

 

 

 

draw

 

public abstract void draw( ChartRenderArgs args)

 

Draws this chart type on surface specified along.

 

Parameters:
args-
instance of ChartRenderArgs that provides facilities to draw this type.

 

Since: 1.0

 

 

 

drawIcon

 

public void drawIcon( Graphics g,
XYRect rect,
ChartPointAttributes point)

 

Draws icon that corresponds to this chart type.

 

Parameters:
g-
instance of Graphics to draw icon on.
rect-
icon bounding rectangle.
point-
attributes used to draw icon.

 

 

 

drawMarkers

 

public void drawMarkers( ChartRenderArgs args)

 

Iterates over points collection for this chart type and draws marker for each point that requires it.

 

Parameters:
args-
instance of ChartRenderArgs that provides facilities to draw markers for this type.

 

Since: 1.0
See also: ChartPointAttributes.setShowLabel(Boolean)ChartPointAttributes.setMarker(Bitmap)

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.