Class DefaultChartScale
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartScale
-
- All Implemented Interfaces:
IsDefaultScale
public final class DefaultChartScale extends Object implements IsDefaultScale
Defaults for scale/axis option element, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DefaultChartScale(Scale scale)
Creates the object by scale option element instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsDefaultAdapters
getAdapters()
Returns the adapter defaults.IsDefaultAngleLines
getAngleLines()
Returns the angle lines default.String
getBackgroundColorAsString()
Returns the background color of the scale area.Bounds
getBounds()
Returns the property controls the scale boundary strategy (bypassed by min/max time options).Display
getDisplay()
Returns how showing the axis.int
getGrace()
Returns the value in pixels is added to the maximum data value and subtracted from the minimum data.
This extends the scale range as if the data values were that much greater.String
getGraceAsPercentage()
Returns the value in percentage is added to the maximum data value and subtracted from the minimum data.
This extends the scale range as if the data values were that much greater.IsDefaultGrid
getGrid()
Returns the grid defaults.double
getMax()
Returns the user defined maximum number for the scale, overrides maximum value from data.double
getMin()
Returns the user defined minimum number for the scale, overrides minimum value from data.IsDefaultPointLabels
getPointLabels()
Returns the point labels defaults.AxisPosition
getPosition()
An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.
To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.
To position the axis at the center of the chart area, set the position option to 'center'.String
getStack()
Returns the stack group.
Axes at the same position with same stack are stacked.double
getStackWeight()
Returns the weight of the scale in stack group.
Used to determine the amount of allocated space for the scale within the group.double
getStartAngle()
Returns the starting angle to draw arcs for the first item in a dataset.double
getSuggestedMax()
Returns the adjustment used when calculating the maximum data value.double
getSuggestedMin()
Returns the adjustment used when calculating the minimum data value.IsDefaultTicks
getTicks()
Returns the ticks defaults.IsDefaultTime
getTime()
Returns the time defaults.IsDefaultScaleTitle
getTitle()
Returns the scale title defaultsdouble
getWeight()
The weight used to sort the axis.boolean
isAlignToPixels()
Returnstrue
to align pixel values to device pixels.boolean
isAnimate()
Returns whether to animate scaling the chart from the center.boolean
isBeginAtZero()
If true, scale will include 0 if it is not already included.boolean
isOffset()
If true, extra space is added to the both edges and the axis is scaled to fit in the chart area.boolean
isReverse()
Returns the reverses order of tick labels.boolean
isSingleStacked()
Returns if you might want to stack positive and negative values together.boolean
isStacked()
Returns if the axis are stacked or not.
-
-
-
Constructor Detail
-
DefaultChartScale
public DefaultChartScale(Scale scale)
Creates the object by scale option element instance.- Parameters:
scale
- scale option element instance.
-
-
Method Detail
-
getTitle
public IsDefaultScaleTitle getTitle()
Description copied from interface:IsDefaultScale
Returns the scale title defaults- Specified by:
getTitle
in interfaceIsDefaultScale
- Returns:
- the scale title defaults.
-
getTicks
public IsDefaultTicks getTicks()
Description copied from interface:IsDefaultScale
Returns the ticks defaults.- Specified by:
getTicks
in interfaceIsDefaultScale
- Returns:
- the ticks defaults.
-
getGrid
public IsDefaultGrid getGrid()
Description copied from interface:IsDefaultScale
Returns the grid defaults.- Specified by:
getGrid
in interfaceIsDefaultScale
- Returns:
- the grid defaults.
-
getAngleLines
public IsDefaultAngleLines getAngleLines()
Description copied from interface:IsDefaultScale
Returns the angle lines default.- Specified by:
getAngleLines
in interfaceIsDefaultScale
- Returns:
- the angleLines defaults.
-
getPointLabels
public IsDefaultPointLabels getPointLabels()
Description copied from interface:IsDefaultScale
Returns the point labels defaults.- Specified by:
getPointLabels
in interfaceIsDefaultScale
- Returns:
- the pointLabels defaults.
-
getTime
public IsDefaultTime getTime()
Description copied from interface:IsDefaultScale
Returns the time defaults.- Specified by:
getTime
in interfaceIsDefaultScale
- Returns:
- the time defaults.
-
getAdapters
public IsDefaultAdapters getAdapters()
Description copied from interface:IsDefaultScale
Returns the adapter defaults.- Specified by:
getAdapters
in interfaceIsDefaultScale
- Returns:
- the adapter defaults.
-
isStacked
public boolean isStacked()
Description copied from interface:IsDefaultScale
Returns if the axis are stacked or not.- Specified by:
isStacked
in interfaceIsDefaultScale
- Returns:
- if the axis are stacked or not.
-
isSingleStacked
public boolean isSingleStacked()
Description copied from interface:IsDefaultScale
Returns if you might want to stack positive and negative values together.- Specified by:
isSingleStacked
in interfaceIsDefaultScale
- Returns:
- if you might want to stack positive and negative values together
-
getWeight
public double getWeight()
Description copied from interface:IsDefaultScale
The weight used to sort the axis. Higher weights are further away from the chart area.- Specified by:
getWeight
in interfaceIsDefaultScale
- Returns:
- weight of axis.
-
getDisplay
public Display getDisplay()
Description copied from interface:IsDefaultScale
Returns how showing the axis.- Specified by:
getDisplay
in interfaceIsDefaultScale
- Returns:
- how showing the axis
-
isOffset
public boolean isOffset()
Description copied from interface:IsDefaultScale
If true, extra space is added to the both edges and the axis is scaled to fit in the chart area.- Specified by:
isOffset
in interfaceIsDefaultScale
- Returns:
- extra space of axis.
-
getPosition
public AxisPosition getPosition()
Description copied from interface:IsDefaultScale
An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.
To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.
To position the axis at the center of the chart area, set the position option to 'center'.- Specified by:
getPosition
in interfaceIsDefaultScale
- Returns:
- position of axis.
-
getBounds
public Bounds getBounds()
Description copied from interface:IsDefaultScale
Returns the property controls the scale boundary strategy (bypassed by min/max time options).- Specified by:
getBounds
in interfaceIsDefaultScale
- Returns:
- property controls the scale boundary strategy (bypassed by min/max time options).
-
isBeginAtZero
public boolean isBeginAtZero()
Description copied from interface:IsDefaultScale
If true, scale will include 0 if it is not already included.- Specified by:
isBeginAtZero
in interfaceIsDefaultScale
- Returns:
- if true, scale will include 0 if it is not already included.
-
getGrace
public int getGrace()
Description copied from interface:IsDefaultScale
Returns the value in pixels is added to the maximum data value and subtracted from the minimum data.
This extends the scale range as if the data values were that much greater.- Specified by:
getGrace
in interfaceIsDefaultScale
- Returns:
- the value in pixels is added to the maximum data value and subtracted from the minimum data
-
getGraceAsPercentage
public String getGraceAsPercentage()
Description copied from interface:IsDefaultScale
Returns the value in percentage is added to the maximum data value and subtracted from the minimum data.
This extends the scale range as if the data values were that much greater.- Specified by:
getGraceAsPercentage
in interfaceIsDefaultScale
- Returns:
- the value in percentage is added to the maximum data value and subtracted from the minimum data
-
getMin
public double getMin()
Description copied from interface:IsDefaultScale
Returns the user defined minimum number for the scale, overrides minimum value from data.- Specified by:
getMin
in interfaceIsDefaultScale
- Returns:
- the user defined minimum number for the scale, overrides minimum value from data.
-
getMax
public double getMax()
Description copied from interface:IsDefaultScale
Returns the user defined maximum number for the scale, overrides maximum value from data.- Specified by:
getMax
in interfaceIsDefaultScale
- Returns:
- user defined maximum number for the scale, overrides maximum value from data.
-
getSuggestedMax
public double getSuggestedMax()
Description copied from interface:IsDefaultScale
Returns the adjustment used when calculating the maximum data value.- Specified by:
getSuggestedMax
in interfaceIsDefaultScale
- Returns:
- adjustment used when calculating the maximum data value.
-
getSuggestedMin
public double getSuggestedMin()
Description copied from interface:IsDefaultScale
Returns the adjustment used when calculating the minimum data value.- Specified by:
getSuggestedMin
in interfaceIsDefaultScale
- Returns:
- adjustment used when calculating the minimum data value.
-
isAlignToPixels
public boolean isAlignToPixels()
Description copied from interface:IsDefaultScale
Returnstrue
to align pixel values to device pixels.- Specified by:
isAlignToPixels
in interfaceIsDefaultScale
- Returns:
true
to align pixel values to device pixels
-
isReverse
public boolean isReverse()
Description copied from interface:IsDefaultScale
Returns the reverses order of tick labels.- Specified by:
isReverse
in interfaceIsDefaultScale
- Returns:
- reverses order of tick labels.
-
isAnimate
public boolean isAnimate()
Description copied from interface:IsDefaultScale
Returns whether to animate scaling the chart from the center.- Specified by:
isAnimate
in interfaceIsDefaultScale
- Returns:
- whether to animate scaling the chart from the center.
-
getStartAngle
public double getStartAngle()
Description copied from interface:IsDefaultScale
Returns the starting angle to draw arcs for the first item in a dataset.- Specified by:
getStartAngle
in interfaceIsDefaultScale
- Returns:
- starting angle to draw arcs for the first item in a dataset.
-
getBackgroundColorAsString
public String getBackgroundColorAsString()
Description copied from interface:IsDefaultScale
Returns the background color of the scale area.- Specified by:
getBackgroundColorAsString
in interfaceIsDefaultScale
- Returns:
- the background color of the scale area.
-
getStack
public String getStack()
Description copied from interface:IsDefaultScale
Returns the stack group.
Axes at the same position with same stack are stacked.- Specified by:
getStack
in interfaceIsDefaultScale
- Returns:
- the stack group.
Axes at the same position with same stack are stacked
-
getStackWeight
public double getStackWeight()
Description copied from interface:IsDefaultScale
Returns the weight of the scale in stack group.
Used to determine the amount of allocated space for the scale within the group.- Specified by:
getStackWeight
in interfaceIsDefaultScale
- Returns:
- the weight of the scale in stack group.
Used to determine the amount of allocated space for the scale within the group
-
-