public abstract class Axis extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Axis(IsChart chart,
ScaleId id,
AxisType type,
AxisKind kind)
Builds the object storing the chart instance.
|
| Modifier and Type | Method and Description |
|---|---|
AxisKind |
getAxis()
Which kind of axis this is.
Possible values are: 'x', 'y' or 'r'. |
AxisBuildTicksCallback |
getAxisBuildTicksCallback()
Returns the user callback that runs before/after of the ticks building.
|
AxisCalculateLabelRotationCallback |
getAxisCalculateLabelRotationCallback()
Returns the user callback that runs before/after tick rotation is determined.
|
AxisDataLimitsCallback |
getAxisDataLimitsCallback()
Returns the user callback that runs before/after data limits are determined.
|
AxisDimensionsCallback |
getAxisDimensionsCallback()
Returns the user callback that runs before/after dimensions are set.
|
AxisFitCallback |
getAxisFitCallback()
Returns the user callback that runs before/after the scale fits to the canvas.
|
AxisTickToLabelConversionCallback |
getAxisTickToLabelConversionCallback()
Returns the user callback that runs before/after ticks are converted in the strings.
|
AxisUpdateCallback |
getAxisUpdateCallback()
Returns the user callback that runs before/after of the update process.
|
IsColor |
getBackgroundColor()
Returns the background color of the scale area.
|
String |
getBackgroundColorAsString()
Returns the background color of the scale area.
|
int |
getCharbaId()
Returns the unique id of axis.
|
IsChart |
getChart()
Returns the chart instance
|
protected T |
getConfiguration()
Returns the configuration element.
|
Display |
getDisplay()
The display option controls the visibility of axis.
Controls the axis global visibility (visible when true, hidden when false). When Display.AUTO, the axis is visible only if at least one associated data set is visible. |
ScaleId |
getId()
The ID is used to link datasets and scale axes together.
This is especially needed if multi-axes charts are used. |
AxisType |
getType()
Returns the type of axis.
|
double |
getWeight()
The weight used to sort the axis.
Higher weights are further away from the chart area. |
boolean |
isAlignToPixels()
Returns
true to align pixel values to device pixels. |
boolean |
isReverse()
Returns the reverses order of tick labels.
|
ChartEnvelop<NativeObject> |
loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only from org.pepstock.charba.client package. |
void |
merge(NativeObjectContainer source,
String property)
Merge a native object in the this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration in the options of chart. |
void |
setAlignToPixels(boolean alignToPixels)
Sets
true to align pixel values to device pixels. |
void |
setAxisBuildTicksCallback(AxisBuildTicksCallback axisBuildTicksCallback)
Sets the user callback that runs before/after of the ticks building.
|
void |
setAxisCalculateLabelRotationCallback(AxisCalculateLabelRotationCallback axisCalculateLabelRotationCallback)
Sets the user callback that runs before/after tick rotation is determined.
|
void |
setAxisDataLimitsCallback(AxisDataLimitsCallback axisDataLimitsCallback)
Sets the user callback that runs before/after data limits are determined.
|
void |
setAxisDimensionsCallback(AxisDimensionsCallback axisDimensionsCallback)
Sets the user callback that runs before/after dimensions are set.
|
void |
setAxisFitCallback(AxisFitCallback axisFitCallback)
Sets the user callback that runs before/after the scale fits to the canvas.
|
void |
setAxisTickToLabelConversionCallback(AxisTickToLabelConversionCallback axisTickToLabelConversionCallback)
Sets the user callback that runs before/after ticks are converted in the strings.
|
void |
setAxisUpdateCallback(AxisUpdateCallback axisUpdateCallback)
Sets the user callback that runs before/after of the update process.
|
void |
setBackgroundColor(IsColor backgroundColor)
Sets the default background color to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setBackgroundColor(String backgroundColor)
Sets the background color of the scale area.
|
protected void |
setConfiguration(T configuration) |
void |
setDisplay(boolean display)
If set to false the axis is hidden from view.
Overrides Grid.setDisplay(boolean), ScaleTitle.setDisplay(boolean), and Tick.setDisplay(boolean). |
void |
setDisplay(Display display)
The display option controls the visibility of axis.
Controls the axis global visibility (visible when true, hidden when false). When Display.AUTO, the axis is visible only if at least one associated data set is visible. |
void |
setReverse(boolean reverse)
Sets the reverses order of tick labels.
|
void |
setWeight(double weight)
The weight used to sort the axis.
Higher weights are further away from the chart area. |
String |
toJSON()
Returns the JSON representation of the object.
|
public final int getCharbaId()
public final ScaleId getId()
DefaultScaleId.UNKNOWN if not setpublic final AxisType getType()
public final AxisKind getAxis()
public void setDisplay(boolean display)
Grid.setDisplay(boolean), ScaleTitle.setDisplay(boolean), and Tick.setDisplay(boolean).display - If set to false the axis is hidden from view.Grid.setDisplay(boolean), ScaleTitle.setDisplay(boolean), and Tick.setDisplay(boolean).public final void setDisplay(Display display)
Display.AUTO, the axis is visible only if at least one associated data set is visible.display - display option controls the visibility of axispublic final Display getDisplay()
Display.AUTO, the axis is visible only if at least one associated data set is visible.public void setBackgroundColor(IsColor backgroundColor)
backgroundColor - background color to use in the chart.public void setBackgroundColor(String backgroundColor)
backgroundColor - the background color of the scale area.public String getBackgroundColorAsString()
public IsColor getBackgroundColor()
public void setWeight(double weight)
weight - weight of axispublic double getWeight()
public void setAlignToPixels(boolean alignToPixels)
true to align pixel values to device pixels.alignToPixels - true to align pixel values to device pixels.public boolean isAlignToPixels()
true to align pixel values to device pixels.true to align pixel values to device pixelspublic void setReverse(boolean reverse)
reverse - reverses order of tick labels.public boolean isReverse()
public AxisCalculateLabelRotationCallback getAxisCalculateLabelRotationCallback()
public void setAxisCalculateLabelRotationCallback(AxisCalculateLabelRotationCallback axisCalculateLabelRotationCallback)
axisCalculateLabelRotationCallback - the axisCalculateLabelRotationCallback to setpublic AxisDataLimitsCallback getAxisDataLimitsCallback()
public void setAxisDataLimitsCallback(AxisDataLimitsCallback axisDataLimitsCallback)
axisDataLimitsCallback - the user callback that runs before/after data limits are determinedpublic AxisDimensionsCallback getAxisDimensionsCallback()
public void setAxisDimensionsCallback(AxisDimensionsCallback axisDimensionsCallback)
axisDimensionsCallback - the user callback that runs before/after dimensions are setpublic AxisFitCallback getAxisFitCallback()
public void setAxisFitCallback(AxisFitCallback axisFitCallback)
axisFitCallback - the user callback that runs before/after the scale fits to the canvaspublic AxisTickToLabelConversionCallback getAxisTickToLabelConversionCallback()
public void setAxisTickToLabelConversionCallback(AxisTickToLabelConversionCallback axisTickToLabelConversionCallback)
axisTickToLabelConversionCallback - the user callback that runs before/after ticks are converted in the stringspublic AxisBuildTicksCallback getAxisBuildTicksCallback()
public void setAxisBuildTicksCallback(AxisBuildTicksCallback axisBuildTicksCallback)
axisBuildTicksCallback - the user callback that runs before/after of the ticks buildingpublic AxisUpdateCallback getAxisUpdateCallback()
public void setAxisUpdateCallback(AxisUpdateCallback axisUpdateCallback)
axisUpdateCallback - the user callback that runs before/after of the update processprotected final void setConfiguration(T configuration)
configuration - the configuration to setprotected final T getConfiguration()
public final void merge(NativeObjectContainer source, String property)
source - native object container to addproperty - property namepublic final String toJSON()
public final ChartEnvelop<NativeObject> loadNativeObject(ChartEnvelop<NativeObject> envelop)
org.pepstock.charba.client package.envelop - envelop instance which will contain the native objectpublic final IsChart getChart()