Package io.jmix.charts.model.axis
Class AbstractAxis<T extends AbstractAxis>
java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.axis.AbstractAxis<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CategoryAxis
,ValueAxis
Base class for
See documentation for properties of AxisBase JS Object.
http://docs.amcharts.com/3/javascriptcharts/AxisBase
ValueAxis
and CategoryAxis
.
See documentation for properties of AxisBase JS Object.
http://docs.amcharts.com/3/javascriptcharts/AxisBase
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDateFormats
(DateFormat... dateFormats) Adds date formats.Adds guides.getColor()
getTitle()
setAutoGridCount
(Boolean autoGridCount) Set autoGridCount to false if you don't want that the number of gridCount will be specified automatically, according to the axis size.setAutoRotateAngle
(Integer autoRotateAngle) Sets angle of label rotation, if the number of series exceeds autoRotateCount.setAutoRotateCount
(Integer autoRotateCount) Sets auto rotate count.setAxisAlpha
(Double axisAlpha) Sets axis opacity.setAxisColor
(Color axisColor) Sets axis color.setAxisThickness
(Integer axisThickness) Sets thickness of the axis.setBalloon
(Balloon balloon) Sets balloon to the axis.setBoldLabels
(Boolean boldLabels) Set boldLabels to true if axis labels should be bold.setBoldPeriodBeginning
(Boolean boldPeriodBeginning) Set boldPeriodBeginning to false if you want chart will not try to highlight the beginning of the periods, like month, in bold.setCenterLabelOnFullPeriod
(Boolean centerLabelOnFullPeriod) Set centerLabelOnFullPeriod to false if you want labels never to be centered between grid lines.setCenterLabels
(Boolean centerLabels) Set centerLabels to true if you want to center labels of the date-based axis (in case it's category axis, equalSpacing must be false).void
setCenterRotatedLabels
(Boolean centerRotatedLabels) In case you have rotated labels on horizontal axis, you can force-center them using this property.Sets color of axis value labels.setDashLength
(Integer dashLength) Sets length of a dash.setDateFormats
(List<DateFormat> dateFormats) Sets list of date formats of different periods.setFillAlpha
(Double fillAlpha) Sets fill opacity.setFillColor
(Color fillColor) Set fill color.setFirstDayOfWeek
(DayOfWeek firstDayOfWeek) Sets first day of the week.setFontSize
(Integer fontSize) Sets size of value labels text.setGridAlpha
(Double gridAlpha) Sets opacity of grid lines.setGridColor
(Color gridColor) Sets color of grid lines.setGridCount
(Integer gridCount) Sets number of grid lines.setGridThickness
(Integer gridThickness) Sets thickness of grid lines.Sets list of guides belonging to this axissetIgnoreAxisWidth
(Boolean ignoreAxisWidth) Set ignoreAxisWidth to true if autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin.Set inside to true if values should be placed inside of plot area.setLabelFrequency
(Double labelFrequency) Sets frequency at which labels should be placed.setLabelOffset
(Integer labelOffset) Sets offset of axes labels.setLabelRotation
(Integer labelRotation) Sets rotation angle of a label.setLabelsEnabled
(Boolean labelsEnabled) Set labelsEnabled to false if you don't wont to display category axis labels and value axis values.setMarkPeriodChange
(Boolean markPeriodChange) Set markPeriodChange to false if the start of longer periods shouldn't use a different date format and shouldn't be bold.setMinHorizontalGap
(Integer minHorizontalGap) Sets minimum cell width required for one span between grid lines.setMinorGridAlpha
(Double minorGridAlpha) Sets opacity of minor grid.setMinorGridEnabled
(Boolean minorGridEnabled) Set minorGridEnabled to true if minor grid should be displayed.setMinorTickLength
(Integer minorTickLength) Sets length of minor grid tick.setMinVerticalGap
(Integer minVerticalGap) Sets minimum cell height required for one span between grid lines.Sets the distance of the axis to the plot area, in pixels.setPosition
(Position position) Sets position.setShowFirstLabel
(Boolean showFirstLabel) Set showFirstLabel to false if you don't want to show first axis label.setShowLastLabel
(Boolean showLastLabel) Set showFirstLabel to false if you don't want to show last axis label.setTickLength
(Integer tickLength) Sets length of the tick marks.Sets title of the axis.setTitleBold
(Boolean titleBold) Set titleBold to false if title shouldn't be bold.setTitleColor
(Color titleColor) Sets color of axis title.setTitleFontSize
(Integer titleFontSize) Sets font size of axis title.setTitleRotation
(Integer titleRotation) Sets rotation of axis title.
-
Constructor Details
-
AbstractAxis
public AbstractAxis()
-
-
Method Details
-
getAutoGridCount
- Returns:
- true if number of gridCount is specified automatically, according to the axis size
-
setAutoGridCount
Set autoGridCount to false if you don't want that the number of gridCount will be specified automatically, according to the axis size. If not set the default value is true.- Parameters:
autoGridCount
- auto grid count option- Returns:
- axis
-
getAxisAlpha
- Returns:
- axis opacity
-
setAxisAlpha
Sets axis opacity. Value range is 0 - 1. If not set the default value is 1.- Parameters:
axisAlpha
- axis opacity- Returns:
- axis
-
getAxisColor
- Returns:
- axis color
-
setAxisColor
Sets axis color. If not set the default value is #000000.- Parameters:
axisColor
- axis color- Returns:
- axis
-
getAxisThickness
- Returns:
- thickness of the axis
-
setAxisThickness
Sets thickness of the axis. If not set the default value is 1.- Parameters:
axisThickness
- thickness of the axis- Returns:
- axis
-
getColor
- Returns:
- color of axis value labels
-
setColor
Sets color of axis value labels. Will use chart's color if not set.- Parameters:
color
- color of axis value labels- Returns:
- axis
-
getDashLength
- Returns:
- length of a dash
-
setDashLength
Sets length of a dash. 0 means line is not dashed. If not set the default value is 0.- Parameters:
dashLength
- length of a dash- Returns:
- axis
-
getFillAlpha
- Returns:
- fill opacity
-
setFillAlpha
Sets fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.- Parameters:
fillAlpha
- fill opacity- Returns:
- axis
-
getFillColor
- Returns:
- fill color
-
setFillColor
Set fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. If not set the default value is #FFFFFF.- Parameters:
fillColor
- fill color- Returns:
- axis
-
getFontSize
- Returns:
- size of value labels text
-
setFontSize
Sets size of value labels text. Will use chart's fontSize if not set.- Parameters:
fontSize
- size of value labels text- Returns:
- axis
-
getGridAlpha
- Returns:
- opacity of grid lines
-
setGridAlpha
Sets opacity of grid lines. If not set the default value is 0.15.- Parameters:
gridAlpha
- opacity of grid lines- Returns:
- axis
-
getGridColor
- Returns:
- color of grid lines
-
setGridColor
Sets color of grid lines. If not set the default value is #000000- Parameters:
gridColor
- color of grid lines- Returns:
- axis
-
getGridCount
- Returns:
- number of grid lines
-
setGridCount
Sets number of grid lines. In case this is value axis, or your categoryAxis parses dates, the number is approximate. The default value is 5. If you set autoGridCount to true, gridCount is ignored. If not set the default value is 5.- Parameters:
gridCount
- grid count- Returns:
- axis
-
getGridThickness
- Returns:
- thickness of grid lines
-
setGridThickness
Sets thickness of grid lines. If not set the default value is 1.- Parameters:
gridThickness
- thickness of grid lines- Returns:
- axis
-
getGuides
- Returns:
- list of guides
-
setGuides
Sets list of guides belonging to this axis- Parameters:
guides
- list of guides- Returns:
- axis
-
addGuides
Adds guides.- Parameters:
guides
- guides- Returns:
- axis
-
getIgnoreAxisWidth
- Returns:
- true if the axis isn't be measured when calculating margin.
-
setIgnoreAxisWidth
Set ignoreAxisWidth to true if autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin. If not set the default value is false.- Parameters:
ignoreAxisWidth
- ignoreAxisWidth option- Returns:
- axis
-
getInside
- Returns:
- true if values placed inside of plot area
-
setInside
Set inside to true if values should be placed inside of plot area. If not set the default value is false.- Parameters:
inside
- inside option- Returns:
- axis
-
getLabelFrequency
- Returns:
- frequency at which labels should be placed
-
setLabelFrequency
Sets frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true. If not set the default value is 1.- Parameters:
labelFrequency
- frequency at which labels should be placed- Returns:
- axis
-
getLabelRotation
- Returns:
- rotation angle of a label
-
setLabelRotation
@StudioProperty(defaultValue="0") @Max(90L) @Min(-90L) public T setLabelRotation(Integer labelRotation) Sets rotation angle of a label. Only horizontal axis values can be rotated. If you set this for vertical axis, the setting will be ignored. Possible values from -90 to 90. If not set the default value is 0.- Parameters:
labelRotation
- rotation angle of a label- Returns:
- axis
-
getLabelsEnabled
- Returns:
- true if axis displays category axis labels and value axis values.
-
setLabelsEnabled
Set labelsEnabled to false if you don't wont to display category axis labels and value axis values. If not set the default value is true.- Parameters:
labelsEnabled
- labelsEnabled option- Returns:
- axis
-
getMinHorizontalGap
- Returns:
- minimum cell width required for one span between grid lines
-
setMinHorizontalGap
Sets minimum cell width required for one span between grid lines. minHorizontalGap is used when calculating grid count (when autoGridCount is true). If not set the default value is 75.- Parameters:
minHorizontalGap
- minimum cell width required for one span between grid lines- Returns:
- axis
-
getMinorGridAlpha
- Returns:
- opacity of minor grid
-
setMinorGridAlpha
@StudioProperty(defaultValue="0.07") @Max(1L) @Min(0L) public T setMinorGridAlpha(Double minorGridAlpha) Sets opacity of minor grid. In order minor to be visible, you should set minorGridEnabled to true. If not set the default value is 0.07.- Parameters:
minorGridAlpha
- opacity of minor grid- Returns:
- axis
-
getMinorGridEnabled
- Returns:
- true if minor grid is displayed
-
setMinorGridEnabled
Set minorGridEnabled to true if minor grid should be displayed. Note, if equalSpacing is set to true, this setting will be ignored. If not set the default value is false.- Parameters:
minorGridEnabled
- minorGridEnabled option- Returns:
- axis
-
getMinVerticalGap
- Returns:
- minimum cell height required for one span between grid lines
-
setMinVerticalGap
Sets minimum cell height required for one span between grid lines. minVerticalGap is used when calculating grid count (when autoGridCount is set to true). If not set the default value is 35.- Parameters:
minVerticalGap
- minimum cell height required for one span between grid lines- Returns:
- axis
-
getOffset
- Returns:
- the distance of the axis to the plot area, in pixels
-
setOffset
Sets the distance of the axis to the plot area, in pixels. Negative values can also be used. If not set the default value is 0.- Parameters:
offset
- the distance of the axis to the plot area, in pixels- Returns:
- axis
-
getPosition
- Returns:
- position
-
setPosition
Sets position. Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom". If not set the default value is BOTTOM.- Parameters:
position
- position- Returns:
- axis
-
getShowFirstLabel
- Returns:
- true if first axis label is shown
-
setShowFirstLabel
Set showFirstLabel to false if you don't want to show first axis label. This works properly only onValueAxis
. WithCategoryAxis
it wont work 100%, it depends on the period, zooming, etc. There is no guaranteed way to force category axis to show or hide first label. If not set the default value is true.- Parameters:
showFirstLabel
- showFirstLabel option- Returns:
- axis
-
getShowLastLabel
- Returns:
- true if last axis label is shown
-
setShowLastLabel
Set showFirstLabel to false if you don't want to show last axis label. This works properly only onValueAxis
. WithCategoryAxis
it wont work 100%, it depends on the period, zooming, etc. There is no guaranteed way to force category axis to show or hide last label. If not set the default value is true.- Parameters:
showLastLabel
- showLastLabel option- Returns:
- axis
-
getTickLength
- Returns:
- length of the tick marks
-
setTickLength
Sets length of the tick marks. If not set the default value is 5.- Parameters:
tickLength
- length of the tick marks- Returns:
- axis
-
getTitle
- Returns:
- title of the axis
-
setTitle
Sets title of the axis.- Parameters:
title
- title of the axis- Returns:
- axis
-
getTitleBold
- Returns:
- true if title is bold
-
setTitleBold
Set titleBold to false if title shouldn't be bold. If not set the default value is true.- Parameters:
titleBold
- titleBold option- Returns:
- axis
-
getTitleColor
- Returns:
- color of axis title
-
setTitleColor
Sets color of axis title. Will use text color of chart if not set any.- Parameters:
titleColor
- color of axis title- Returns:
- axis
-
getTitleFontSize
- Returns:
- font size of axis title
-
setTitleFontSize
Sets font size of axis title. Will use font size of chart plus two pixels if not set any.- Parameters:
titleFontSize
- font size of axis title- Returns:
- axis
-
getBoldLabels
- Returns:
- true if axis labels are bold.
-
setBoldLabels
Set boldLabels to true if axis labels should be bold. If not set the default value is false.- Parameters:
boldLabels
- bold labels option- Returns:
- axis
-
getAutoRotateAngle
- Returns:
- angle of label rotation
-
setAutoRotateAngle
Sets angle of label rotation, if the number of series exceeds autoRotateCount. Works on horizontal axis only. It is not recommended to use it with charts with zoom/scroll features, as chart adjusts margin only based on initial render.- Parameters:
autoRotateAngle
- angle of label rotation- Returns:
- axis
-
getAutoRotateCount
- Returns:
- auto rotate count
-
setAutoRotateCount
Sets auto rotate count. If the number of category axis items will exceed the autoRotateCount, the labels will be rotated by autoRotateAngle degree. Works on horizontal axis only. Not recommended with scrollable/zoomable charts.- Parameters:
autoRotateCount
- auto rotate count- Returns:
- axis
-
getCenterLabels
- Returns:
- true if labels of the date-based axis is centered
-
setCenterLabels
Set centerLabels to true if you want to center labels of the date-based axis (in case it's category axis, equalSpacing must be false). If not set the default value is false.- Parameters:
centerLabels
- center labels option- Returns:
- axis
-
getDateFormats
- Returns:
- list of date formats of different periods
-
setDateFormats
Sets list of date formats of different periods. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. If not set the default value is[{"period":"fff", "format":"JJ:NN:SS"}, {"period":"ss", "format":"JJ:NN:SS"}, {"period":"mm", "format":"JJ:NN"}, {"period":"hh", "format":"JJ:NN"}, {"period":"DD", "format":"MMM DD"}, {"period":"WW", "format":"MMM DD"}, {"period":"MM", "format":"MMM"}, {"period":"YYYY", "format":"YYYY"}]
- Parameters:
dateFormats
- list of date formats- Returns:
- axis
-
addDateFormats
Adds date formats.- Parameters:
dateFormats
- date formats- Returns:
- axis
-
getMinorTickLength
- Returns:
- length of minor grid tick
-
setMinorTickLength
Sets length of minor grid tick. If not set the default value is 0.- Parameters:
minorTickLength
- length of minor grid tick- Returns:
- axis
-
getTitleRotation
- Returns:
- rotation of axis title
-
setTitleRotation
Sets rotation of axis title. Useful if you want to make vertical axis title to be shown from top to down.- Parameters:
titleRotation
- rotation of axis title- Returns:
- axis
-
getBalloon
- Returns:
- balloon
-
setBalloon
Sets balloon to the axis.- Parameters:
balloon
- balloon- Returns:
- axis
-
getBoldPeriodBeginning
- Returns:
- true if chart highlights the beginning of the periods in bold
-
setBoldPeriodBeginning
Set boldPeriodBeginning to false if you want chart will not try to highlight the beginning of the periods, like month, in bold. If not set the default value is true.- Parameters:
boldPeriodBeginning
- boldPeriodBeginning option- Returns:
- axis
-
getCenterLabelOnFullPeriod
- Returns:
- true if labels centered between grid lines
-
setCenterLabelOnFullPeriod
@StudioProperty(defaultValue="true") public T setCenterLabelOnFullPeriod(Boolean centerLabelOnFullPeriod) Set centerLabelOnFullPeriod to false if you want labels never to be centered between grid lines. This setting works only when parseDates is set to true and equalSpacing is set to false. If not set the default value is true.- Parameters:
centerLabelOnFullPeriod
- centerLabelOnFullPeriod option- Returns:
- axis
-
getFirstDayOfWeek
- Returns:
- first day of the week
-
setFirstDayOfWeek
Sets first day of the week. 0 is Sunday, 1 is Monday, etc. If not set the default value is 1.- Parameters:
firstDayOfWeek
- first day of the week- Returns:
- axis
-
getLabelOffset
- Returns:
- offset of axes labels
-
setLabelOffset
Sets offset of axes labels. Works both withCategoryAxis
andValueAxis
. If not set the default value is 0.- Parameters:
labelOffset
- offset of axes labels- Returns:
- axis
-
getMarkPeriodChange
- Returns:
- true if the start of longer periods uses a different date
-
setMarkPeriodChange
Set markPeriodChange to false if the start of longer periods shouldn't use a different date format and shouldn't be bold. If not set the default value is true.- Parameters:
markPeriodChange
- markPeriodChange option- Returns:
- axis
-
getCenterRotatedLabels
- Returns:
- true if rotated labels are force-centered
-
setCenterRotatedLabels
@StudioProperty(defaultValue="false") public void setCenterRotatedLabels(Boolean centerRotatedLabels) In case you have rotated labels on horizontal axis, you can force-center them using this property. If not set the default value is false.- Parameters:
centerRotatedLabels
- centerRotatedLabels option
-