Package io.jmix.charts.model.axis
Class ValueAxis
- All Implemented Interfaces:
Serializable
Create an axis for
See documentation for properties of ValueAxis JS Object.
http://docs.amcharts.com/3/javascriptcharts/ValueAxis
SerialChartModelImpl
, RadarChartModelImpl
, XYChartModelImpl
, charts, multiple can be assigned.
Gets automatically populated, one for SerialChart and two for XYChart charts, if none has been specified.
See documentation for properties of ValueAxis JS Object.
http://docs.amcharts.com/3/javascriptcharts/ValueAxis
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
getType()
getUnit()
void
setAutoWrap
(Boolean autoWrap) If this is set to true and the label does not fit, it will be wrapped.setAxisFrequency
(Double axisFrequency) Sets axis frequency.setAxisTitleOffset
(Integer axisTitleOffset) Sets the distance from axis to the axis title (category).setBalloonTextFunction
(JsFunction balloonTextFunction) Sets JS function to format balloon text of the axis.setBaseValue
(Double baseValue) Sets the base value of the axis.setDuration
(Duration duration) Set the duration unit if your values represents time units, and you want value axis labels to be formatted as duration.setDurationUnits
(Map<Duration, String> durationUnits) If duration property is set, you can specify what string should be displayed next to day, hour, minute and second.setGridType
(GridType gridType) Sets grid type.Sets unique id of value axis.setIncludeAllValues
(Boolean includeAllValues) Set includeAllValues to true if minimum and maximum of value axis shouldn't change while zooming/scrolling.setIncludeGuidesInMinMax
(Boolean includeGuidesInMinMax) Set includeGuidesInMinMax to true the guide values should be included when calculating minimum and maximum of the axis.setIncludeHidden
(Boolean includeHidden) Sets includeHidden to true if the axis should include hidden graphs when calculating minimum and maximum values.setIntegersOnly
(Boolean integersOnly) Set integersOnly to true if values on the axis can only be integers.setLabelFunction
(JsFunction labelFunction) Sets JS function to format value axis labels.setLogarithmic
(Boolean logarithmic) Set logarithmic to true if this value axis scale should be logarithmic.setMaximum
(Double maximum) Set maximum value if you don't want maximum value to be calculated by the chart.setMaximumDate
(Date maximumDate) Sets maximum date of the axis, if your value axis is date-based.setMinimum
(Double minimum) Set minimum value if you don't want minimum value to be calculated by the chart.setMinimumDate
(Date minimumDate) Sets minimum date of the axis, if your value axis is date-based.setMinMaxMultiplier
(Double minMaxMultiplier) Sets minimum and maximum multiplier.void
setMinPeriod
(DatePeriod minPeriod) Sets the shortest period of your data.setPointPosition
(PointPosition pointPosition) Sets point position.setPrecision
(Integer precision) Sets precision (number of decimals) of values.setRadarCategoriesEnabled
(Boolean radarCategoriesEnabled) Set radarCategoriesEnabled to false if categories (axes titles) shouldn't be displayed near axes.setRecalculateToPercents
(Boolean recalculateToPercents) Set recalculateToPercents to true, if graphs values should be recalculated to percents.setReversed
(Boolean reversed) Set reversed to true if value axis should be reversed (smaller values on top).setStackType
(StackType stackType) Sets stacking mode of the axis.setStrictMinMax
(Boolean strictMinMax) If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the beginning and end of plot area and grid would be at equal intervals.setSynchronizationMultiplier
(Double synchronizationMultiplier) Set the synchronization multiplier, in case you synchronize one value axis with another.setSynchronizeWith
(String synchronizeWith) One value axis can be synchronized with another value axis.setTotalText
(String totalText) Sets total text.setTotalTextColor
(Color totalTextColor) Sets color of total text.setTotalTextOffset
(Integer totalTextOffset) Sets distance from data point to total text.setTreatZeroAs
(Double treatZeroAs) This allows you to have logarithmic value axis and have zero values in the data.setType
(ValueAxisType type) Sets type of value axis.Sets unit which will be added to the value label.setUnitPosition
(UnitPosition unitPosition) Sets position of the unit.setUsePrefixes
(Boolean usePrefixes) Set usePrefixes to true, if prefixes should be used for big and small numbers.setUseScientificNotation
(Boolean useScientificNotation) Set useScientificNotation to true if values should always be formatted using scientific notation (5e+8, 5e-8...).@Max(1L) @Min(0L) ValueAxis
setZeroGridAlpha
(Double zeroGridAlpha) Sets opacity of a zero grid line.Methods inherited from class io.jmix.charts.model.axis.AbstractAxis
addDateFormats, addGuides, getAutoGridCount, getAutoRotateAngle, getAutoRotateCount, getAxisAlpha, getAxisColor, getAxisThickness, getBalloon, getBoldLabels, getBoldPeriodBeginning, getCenterLabelOnFullPeriod, getCenterLabels, getCenterRotatedLabels, getColor, getDashLength, getDateFormats, getFillAlpha, getFillColor, getFirstDayOfWeek, getFontSize, getGridAlpha, getGridColor, getGridCount, getGridThickness, getGuides, getIgnoreAxisWidth, getInside, getLabelFrequency, getLabelOffset, getLabelRotation, getLabelsEnabled, getMarkPeriodChange, getMinHorizontalGap, getMinorGridAlpha, getMinorGridEnabled, getMinorTickLength, getMinVerticalGap, getOffset, getPosition, getShowFirstLabel, getShowLastLabel, getTickLength, getTitle, getTitleBold, getTitleColor, getTitleFontSize, getTitleRotation, setAutoGridCount, setAutoRotateAngle, setAutoRotateCount, setAxisAlpha, setAxisColor, setAxisThickness, setBalloon, setBoldLabels, setBoldPeriodBeginning, setCenterLabelOnFullPeriod, setCenterLabels, setCenterRotatedLabels, setColor, setDashLength, setDateFormats, setFillAlpha, setFillColor, setFirstDayOfWeek, setFontSize, setGridAlpha, setGridColor, setGridCount, setGridThickness, setGuides, setIgnoreAxisWidth, setInside, setLabelFrequency, setLabelOffset, setLabelRotation, setLabelsEnabled, setMarkPeriodChange, setMinHorizontalGap, setMinorGridAlpha, setMinorGridEnabled, setMinorTickLength, setMinVerticalGap, setOffset, setPosition, setShowFirstLabel, setShowLastLabel, setTickLength, setTitle, setTitleBold, setTitleColor, setTitleFontSize, setTitleRotation
-
Constructor Details
-
ValueAxis
public ValueAxis()
-
-
Method Details
-
getAxisTitleOffset
- Returns:
- the distance from axis to the axis title (category)
-
setAxisTitleOffset
Sets the distance from axis to the axis title (category). Work with radar chart only. If not set the default value is 10.- Parameters:
axisTitleOffset
- axis title offset- Returns:
- value axis
-
getBaseValue
- Returns:
- the base value of the axis
-
setBaseValue
Sets the base value of the axis. If not set the default value is 0.- Parameters:
baseValue
- base value- Returns:
- value axis
-
getDuration
- Returns:
- the duration unit
-
setDuration
Set the duration unit if your values represents time units, and you want value axis labels to be formatted as duration. Possible values are: "ss", "mm", "hh" and "DD".- Parameters:
duration
- duration- Returns:
- value axis
-
getDurationUnits
- Returns:
- duration units map
-
setDurationUnits
If duration property is set, you can specify what string should be displayed next to day, hour, minute and second. I.e. pairs like: "DD": "d.", "hh": ":", "mm": ":", "ss": " ". If not set the default value is{DD:'d. ', hh:':', mm:':',ss:''}
- Parameters:
durationUnits
- duration units map- Returns:
- value axis
-
getGridType
- Returns:
- grid type
-
setGridType
@StudioProperty(type=ENUMERATION, defaultValue="POLYGONS") public ValueAxis setGridType(GridType gridType) Sets grid type. Possible values are: "polygons" and "circles". Set "circles" for polar charts. Work with radar chart only. If not set the default value is POLYGONS.- Parameters:
gridType
- grid type- Returns:
- value axis
-
getId
- Returns:
- unique id of value axis
-
setId
Sets unique id of value axis. It is not required to set it, unless you need to tell the graph which exact value axis it should use.- Parameters:
id
- id- Returns:
- value axis
-
getIncludeGuidesInMinMax
- Returns:
- true the guide values are included when calculating minimum and maximum of the axis
-
setIncludeGuidesInMinMax
@StudioProperty(defaultValue="false") public ValueAxis setIncludeGuidesInMinMax(Boolean includeGuidesInMinMax) Set includeGuidesInMinMax to true the guide values should be included when calculating minimum and maximum of the axis. If not set the default value is false.- Parameters:
includeGuidesInMinMax
- includeGuidesInMinMax option- Returns:
- value axis
-
getIncludeHidden
- Returns:
- true if the axis includes hidden graphs when calculating minimum and maximum values
-
setIncludeHidden
Sets includeHidden to true if the axis should include hidden graphs when calculating minimum and maximum values. If not set the default value is false.- Parameters:
includeHidden
- includeHidden option- Returns:
- value axis
-
getIntegersOnly
- Returns:
- true if values on the axis are only integers
-
setIntegersOnly
Set integersOnly to true if values on the axis can only be integers. If not set the default value is false.- Parameters:
integersOnly
- integersOnly option- Returns:
- value axis
-
getLogarithmic
- Returns:
- true if this value axis scale is logarithmic
-
setLogarithmic
Set logarithmic to true if this value axis scale should be logarithmic. If not set the default value is false.- Parameters:
logarithmic
- logarithmic option- Returns:
- value axis
-
getMaximum
- Returns:
- maximum value
-
setMaximum
Set maximum value if you don't want maximum value to be calculated by the chart. This value might still be adjusted so that it would be possible to draw grid at rounded intervals.- Parameters:
maximum
- maximum value- Returns:
- value axis
-
getMinimum
- Returns:
- minimum value
-
setMinimum
Set minimum value if you don't want minimum value to be calculated by the chart. This value might still be adjusted so that it would be possible to draw grid at rounded intervals.- Parameters:
minimum
- minimum value- Returns:
- value axis
-
getMinMaxMultiplier
- Returns:
- minimum and maximum multiplier
-
setMinMaxMultiplier
Sets minimum and maximum multiplier. If set value axis scale (min and max numbers) will be multiplied by it. I.e. if set to 1.2 the scope of values will increase by 20%. If not set the default value is 1.- Parameters:
minMaxMultiplier
- minimum and maximum multiplier- Returns:
- value axis
-
getPrecision
- Returns:
- precision (number of decimals) of values
-
setPrecision
Sets precision (number of decimals) of values.- Parameters:
precision
- precision- Returns:
- value axis
-
getRadarCategoriesEnabled
- Returns:
- true if categories (axes titles) are displayed near axes
-
setRadarCategoriesEnabled
@StudioProperty(defaultValue="true") public ValueAxis setRadarCategoriesEnabled(Boolean radarCategoriesEnabled) Set radarCategoriesEnabled to false if categories (axes titles) shouldn't be displayed near axes. If not set the default value is true.- Parameters:
radarCategoriesEnabled
- radarCategoriesEnabled option- Returns:
- value axis
-
getRecalculateToPercents
- Returns:
- true if graphs values are recalculated to percents
-
setRecalculateToPercents
@StudioProperty(defaultValue="false") public ValueAxis setRecalculateToPercents(Boolean recalculateToPercents) Set recalculateToPercents to true, if graphs values should be recalculated to percents. Note, that this setting will work only on serial chart (and stock), not on any other charts that are usingValueAxis
, like XY chart. If not set the default value is false.- Parameters:
recalculateToPercents
- recalculateToPercents option- Returns:
- value axis
-
getReversed
- Returns:
- true if value axis is reversed
-
setReversed
Set reversed to true if value axis should be reversed (smaller values on top). If not set the default value is false.- Parameters:
reversed
- reversed option- Returns:
- value axis
-
getStackType
- Returns:
- stacking mode of the axis
-
setStackType
@StudioProperty(type=ENUMERATION, defaultValue="NONE") public ValueAxis setStackType(StackType stackType) Sets stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". Note, only graphs of one type will be stacked. If not set the default value is NONE.- Parameters:
stackType
- stack type- Returns:
- value axis
-
getSynchronizationMultiplier
- Returns:
- synchronization multiplier
-
setSynchronizationMultiplier
Set the synchronization multiplier, in case you synchronize one value axis with another.- Parameters:
synchronizationMultiplier
- synchronization multiplier- Returns:
- value axis
-
getTotalText
- Returns:
- total text
-
setTotalText
Sets total text. If this value axis is stacked and has columns, setting to "[[total]]" will make it to display total value above the most-top column.- Parameters:
totalText
- total text- Returns:
- value axis
-
getTotalTextColor
- Returns:
- color of total text
-
setTotalTextColor
Sets color of total text.- Parameters:
totalTextColor
- color- Returns:
- value axis
-
getUnit
- Returns:
- unit which is added to the value label
-
setUnit
Sets unit which will be added to the value label.- Parameters:
unit
- unit- Returns:
- value axis
-
getUnitPosition
- Returns:
- position of the unit
-
setUnitPosition
@StudioProperty(type=ENUMERATION, defaultValue="RIGHT") public ValueAxis setUnitPosition(UnitPosition unitPosition) Sets position of the unit. Possible values are LEFT and RIGHT. If not set the default value is RIGHT.- Parameters:
unitPosition
- unit position- Returns:
- value axis
-
getUsePrefixes
- Returns:
- true if prefixes are used for big and small numbers
-
setUsePrefixes
Set usePrefixes to true, if prefixes should be used for big and small numbers. You can set list of prefixes directly to the chart viaprefixesOfSmallNumbers
andprefixesOfBigNumbers
. If not set the default value is false.- Parameters:
usePrefixes
- usePrefixes option- Returns:
- value axis
-
getUseScientificNotation
- Returns:
- true if values are formatted using scientific notation (5e+8, 5e-8...)
-
setUseScientificNotation
@StudioProperty(defaultValue="false") public ValueAxis setUseScientificNotation(Boolean useScientificNotation) Set useScientificNotation to true if values should always be formatted using scientific notation (5e+8, 5e-8...). Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation. If not set the default value is false.- Parameters:
useScientificNotation
- useScientificNotation option- Returns:
- value axis
-
getSynchronizeWith
- Returns:
- synchronized value axis id
-
setSynchronizeWith
One value axis can be synchronized with another value axis. You can use id of the axis here. You should set synchronizationMultiplier in order for this to work.- Parameters:
synchronizeWith
- id of the axis- Returns:
- value axis
-
getTotalTextOffset
- Returns:
- distance from data point to total text
-
setTotalTextOffset
Sets distance from data point to total text. If not set the default value is 0.- Parameters:
totalTextOffset
- total text offset- Returns:
- value axis
-
getTreatZeroAs
- Returns:
- treatZeroAs value
-
setTreatZeroAs
This allows you to have logarithmic value axis and have zero values in the data. You must set it to greater than 0 value in order to work. If not set the default value is 0.- Parameters:
treatZeroAs
- treatZeroAs value- Returns:
- value axis
-
getIncludeAllValues
- Returns:
- true if minimum and maximum of value axis doesn't change while zooming/scrolling
-
setIncludeAllValues
@StudioProperty(defaultValue="false") public ValueAxis setIncludeAllValues(Boolean includeAllValues) Set includeAllValues to true if minimum and maximum of value axis shouldn't change while zooming/scrolling. If not set the default value is false.- Parameters:
includeAllValues
- includeAllValues option- Returns:
- value axis
-
getLabelFunction
- Returns:
- JS function to format value axis labels
-
setLabelFunction
Sets JS function to format value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. If axis type is "date", labelFunction will pass different arguments: labelFunction(valueText, date, valueAxis). Your function should return string.- Parameters:
labelFunction
- JS function- Returns:
- value axis
-
getMaximumDate
- Returns:
- maximum date of the axis
-
setMaximumDate
Sets maximum date of the axis, if your value axis is date-based.- Parameters:
maximumDate
- maximum date- Returns:
- value axis
-
getMinimumDate
- Returns:
- minimum date of the axis
-
setMinimumDate
Sets minimum date of the axis, if your value axis is date-based.- Parameters:
minimumDate
- minimum date- Returns:
- value axis
-
getPointPosition
- Returns:
- point position
-
setPointPosition
@StudioProperty(type=ENUMERATION, defaultValue="START") public ValueAxis setPointPosition(PointPosition pointPosition) Sets point position. If you set it to “middle”, labels and data points will be placed in the middle between axes. Works with radar charts only. If not set the default value is START.- Parameters:
pointPosition
- point position- Returns:
- value axis
-
getStrictMinMax
- Returns:
- true if the chart doesn't adjust minimum and maximum of value axis
-
setStrictMinMax
If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the beginning and end of plot area and grid would be at equal intervals. If you set strictMinMax to true, the chart will not adjust minimum and maximum of value axis. If not set the default value is false.- Parameters:
strictMinMax
- strictMinMax option- Returns:
- value axis
-
getType
- Returns:
- type of value axis
-
setType
@StudioProperty(type=ENUMERATION, defaultValue="NUMERIC") public ValueAxis setType(ValueAxisType type) Sets type of value axis. If your values in data provider are dates and you want this axis to show dates instead of numbers, set it to "date". If not set the default value is NUMERIC.- Parameters:
type
- type- Returns:
- value axis
-
getZeroGridAlpha
- Returns:
- opacity of a zero grid line
-
setZeroGridAlpha
@StudioProperty @Max(1L) @Min(0L) public @Max(1L) @Min(0L) ValueAxis setZeroGridAlpha(Double zeroGridAlpha) Sets opacity of a zero grid line. By default it is equal to 2 x gridAlpha.- Parameters:
zeroGridAlpha
- opacity- Returns:
- value axis
-
getAxisFrequency
- Returns:
- axis frequency
-
setAxisFrequency
Sets axis frequency. If you have a big number of axes, this property will help you to show every X axis only. Works with radar chart only. If not set the default value is 1.- Parameters:
axisFrequency
- axis frequency- Returns:
- value axis
-
getBalloonTextFunction
- Returns:
- JS function to format balloon text of the axis
-
setBalloonTextFunction
Sets JS function to format balloon text of the axis. This function is called and balloon text or date (if axis is date-based) is passed as an argument. It should return string which will be displayed in the balloon.- Parameters:
balloonTextFunction
- JS function- Returns:
- value axis
-
getAutoWrap
- Returns:
- true if autoWrap is enabled
-
setAutoWrap
If this is set to true and the label does not fit, it will be wrapped. Works only on horizontal value axes. If not set the default value is false.- Parameters:
autoWrap
- autoWrap option
-
getMinPeriod
- Returns:
- the shortest period of your data
-
setMinPeriod
@StudioProperty(type=ENUMERATION, defaultValue="DAYS") public void setMinPeriod(DatePeriod minPeriod) Sets the shortest period of your data. This will work only if you set the type of your value axis to "date". If not set the default value is "DD".- Parameters:
minPeriod
- shortest period
-