public class Scale extends AbstractItem
chart.defaults.scale
.Modifier | Constructor and Description |
---|---|
protected |
Scale(AbstractItem parent,
Key childKey)
Builds the object with parent item and child.
|
|
Scale(GenericJavaScriptObject javaScriptObject)
Creates the object using the java script object with the defaults provided by CHART.JS.
It's a root element. |
Modifier and Type | Method and Description |
---|---|
AngleLines |
getAngleLines() |
double |
getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width.
|
int |
getBarThickness()
Returns the width of each bar in pixels.
|
double |
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.
|
GridLines |
getGrideLines() |
java.lang.String |
getId()
The ID is used to link datasets and scale axes together.
This is especially needed if multi-axes charts are used. |
int |
getMaxBarThickness()
Returns the maximum bar thickness.
|
PointLabels |
getPointLabels() |
Position |
getPosition()
Position of the axis in the chart.
|
ScaleLabel |
getScaleLabel() |
Ticks |
getTicks() |
AxisType |
getType()
Returns the type of axis.
|
int |
getWeight()
The weight used to sort the axis.
|
boolean |
isDisplay()
If true, shows the axis.
|
boolean |
isOffset()
If true, extra space is added to the both edges and the axis is scaled to fit into the chart area.
|
boolean |
isStacked()
Returns if the axis are stacked or not.
|
void |
setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width.
|
void |
setBarThickness(int barThickness)
Sets the width of each bar in pixels.
|
void |
setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.
|
void |
setDisplay(boolean display)
If true, shows the axis.
|
void |
setId(java.lang.String id)
The ID is used to link datasets and scale axes together.
This is especially needed if multi-axes charts are used. |
void |
setMaxBarThickness(int maxBarThickness)
Sets the maximum bar thickness, to ensure that bars are not sized thicker than this
|
void |
setOffset(boolean offset)
If true, extra space is added to the both edges and the axis is scaled to fit into the chart area.
|
void |
setPosition(Position position)
Position of the axis in the chart.
|
void |
setStacked(boolean stacked)
Sets if the axis are stacked or not.
|
void |
setType(AxisType type)
Type of scale being employed.
|
void |
setWeight(int weight)
The weight used to sort the axis.
|
checkAndAddToParent, hasProperty
checkAndGetDoubleValues, checkAndGetEnumValues, checkAndGetIntegerValues, checkAndGetStringValues, checkAndSetDoubleValues, checkAndSetEnumValues, checkAndSetIntegerValues, checkAndSetStringValues, getDoubleArray, getIntegerArray, getJavaScriptObject, getObjectArray, getStringArray, getValue, getValue, getValue, getValue, getValue, getValue, getValue, has, has, hasToBeRegistered, isEmpty, keys, remove, remove, removeIfExists, setDoubleArray, setEnumValueArray, setIntegerArray, setObjectArray, setStringArray, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, type
public Scale(GenericJavaScriptObject javaScriptObject)
javaScriptObject
- the java script object with the defaults provided by CHART.JS.protected Scale(AbstractItem parent, Key childKey)
parent
- parent item.childKey
- key of child.public ScaleLabel getScaleLabel()
ScaleLabel
public AngleLines getAngleLines()
AngleLines
public PointLabels getPointLabels()
PointLabels
public void setId(java.lang.String id)
id
- The ID is used to link datasets and scale axes togetherpublic java.lang.String getId()
null
if not setpublic void setStacked(boolean stacked)
stacked
- if the axis are stacked or not.public boolean isStacked()
false
.public void setType(AxisType type)
type
- type of axisAxisType
public AxisType getType()
AxisType.linear
.AxisType
public void setWeight(int weight)
weight
- weight of axispublic int getWeight()
public void setDisplay(boolean display)
display
- if true, shows the axes.public boolean isDisplay()
public void setOffset(boolean offset)
offset
- extra space of axispublic boolean isOffset()
false
.public void setPosition(Position position)
position
- position of axisPosition
public Position getPosition()
Position.top
.Position
public void setBarPercentage(double barPercentage)
barPercentage
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the
whole category width and put the bars right next to each other.public double getBarPercentage()
public void setCategoryPercentage(double categoryPercentage)
categoryPercentage
- percent (0-1) of the available width each category should be within the sample width.public double getCategoryPercentage()
public void setBarThickness(int barThickness)
barThickness
- width of each bar in pixels. If not set, the base sample widths are calculated automatically so that
they take the full available widths without overlap. Then, the bars are sized using barPercentage and
categoryPercentage.public int getBarThickness()
public void setMaxBarThickness(int maxBarThickness)
maxBarThickness
- the maximum bar thickness.public int getMaxBarThickness()