Class ValueAxis

All Implemented Interfaces:
Serializable

public class ValueAxis extends AbstractAxis<ValueAxis>
Create an axis for 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 Details

    • ValueAxis

      public ValueAxis()
  • Method Details

    • getAxisTitleOffset

      public Integer getAxisTitleOffset()
      Returns:
      the distance from axis to the axis title (category)
    • setAxisTitleOffset

      @StudioProperty(defaultValue="10") public ValueAxis setAxisTitleOffset(Integer axisTitleOffset)
      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

      public Double getBaseValue()
      Returns:
      the base value of the axis
    • setBaseValue

      @StudioProperty(defaultValue="0") public ValueAxis setBaseValue(Double baseValue)
      Sets the base value of the axis. If not set the default value is 0.
      Parameters:
      baseValue - base value
      Returns:
      value axis
    • getDuration

      public Duration getDuration()
      Returns:
      the duration unit
    • setDuration

      @StudioProperty(type=ENUMERATION) public ValueAxis setDuration(Duration duration)
      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

      public Map<Duration,String> getDurationUnits()
      Returns:
      duration units map
    • setDurationUnits

      public ValueAxis 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. 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

      public GridType 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

      public String getId()
      Returns:
      unique id of value axis
    • setId

      @StudioProperty public ValueAxis setId(String id)
      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

      public Boolean 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

      public Boolean getIncludeHidden()
      Returns:
      true if the axis includes hidden graphs when calculating minimum and maximum values
    • setIncludeHidden

      @StudioProperty(defaultValue="false") public ValueAxis setIncludeHidden(Boolean includeHidden)
      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

      public Boolean getIntegersOnly()
      Returns:
      true if values on the axis are only integers
    • setIntegersOnly

      @StudioProperty(defaultValue="false") public ValueAxis setIntegersOnly(Boolean integersOnly)
      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

      public Boolean getLogarithmic()
      Returns:
      true if this value axis scale is logarithmic
    • setLogarithmic

      @StudioProperty(defaultValue="false") public ValueAxis setLogarithmic(Boolean logarithmic)
      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

      public Double getMaximum()
      Returns:
      maximum value
    • setMaximum

      @StudioProperty public ValueAxis setMaximum(Double maximum)
      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

      public Double getMinimum()
      Returns:
      minimum value
    • setMinimum

      @StudioProperty public ValueAxis setMinimum(Double minimum)
      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

      public Double getMinMaxMultiplier()
      Returns:
      minimum and maximum multiplier
    • setMinMaxMultiplier

      @StudioProperty(defaultValue="1") public ValueAxis setMinMaxMultiplier(Double minMaxMultiplier)
      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

      public Integer getPrecision()
      Returns:
      precision (number of decimals) of values
    • setPrecision

      @StudioProperty public ValueAxis setPrecision(Integer precision)
      Sets precision (number of decimals) of values.
      Parameters:
      precision - precision
      Returns:
      value axis
    • getRadarCategoriesEnabled

      public Boolean 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

      public Boolean 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 using ValueAxis, like XY chart. If not set the default value is false.
      Parameters:
      recalculateToPercents - recalculateToPercents option
      Returns:
      value axis
    • getReversed

      public Boolean getReversed()
      Returns:
      true if value axis is reversed
    • setReversed

      @StudioProperty(defaultValue="false") public ValueAxis setReversed(Boolean reversed)
      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

      public StackType 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

      public Double getSynchronizationMultiplier()
      Returns:
      synchronization multiplier
    • setSynchronizationMultiplier

      @StudioProperty public ValueAxis setSynchronizationMultiplier(Double synchronizationMultiplier)
      Set the synchronization multiplier, in case you synchronize one value axis with another.
      Parameters:
      synchronizationMultiplier - synchronization multiplier
      Returns:
      value axis
    • getTotalText

      public String getTotalText()
      Returns:
      total text
    • setTotalText

      @StudioProperty public ValueAxis setTotalText(String totalText)
      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

      public Color getTotalTextColor()
      Returns:
      color of total text
    • setTotalTextColor

      @StudioProperty(type=OPTIONS) public ValueAxis setTotalTextColor(Color totalTextColor)
      Sets color of total text.
      Parameters:
      totalTextColor - color
      Returns:
      value axis
    • getUnit

      public String getUnit()
      Returns:
      unit which is added to the value label
    • setUnit

      @StudioProperty public ValueAxis setUnit(String unit)
      Sets unit which will be added to the value label.
      Parameters:
      unit - unit
      Returns:
      value axis
    • getUnitPosition

      public UnitPosition 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

      public Boolean getUsePrefixes()
      Returns:
      true if prefixes are used for big and small numbers
    • setUsePrefixes

      @StudioProperty(defaultValue="false") public ValueAxis setUsePrefixes(Boolean usePrefixes)
      Set usePrefixes to true, if prefixes should be used for big and small numbers. You can set list of prefixes directly to the chart via prefixesOfSmallNumbers and prefixesOfBigNumbers. If not set the default value is false.
      Parameters:
      usePrefixes - usePrefixes option
      Returns:
      value axis
    • getUseScientificNotation

      public Boolean 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

      public String getSynchronizeWith()
      Returns:
      synchronized value axis id
    • setSynchronizeWith

      @StudioProperty public ValueAxis setSynchronizeWith(String synchronizeWith)
      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

      public Integer getTotalTextOffset()
      Returns:
      distance from data point to total text
    • setTotalTextOffset

      @StudioProperty(defaultValue="0") public ValueAxis setTotalTextOffset(Integer totalTextOffset)
      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

      public Double getTreatZeroAs()
      Returns:
      treatZeroAs value
    • setTreatZeroAs

      @StudioProperty(defaultValue="0") public ValueAxis setTreatZeroAs(Double treatZeroAs)
      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

      public Boolean 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

      public JsFunction getLabelFunction()
      Returns:
      JS function to format value axis labels
    • setLabelFunction

      public ValueAxis setLabelFunction(JsFunction labelFunction)
      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

      public Date getMaximumDate()
      Returns:
      maximum date of the axis
    • setMaximumDate

      @StudioProperty public ValueAxis setMaximumDate(Date maximumDate)
      Sets maximum date of the axis, if your value axis is date-based.
      Parameters:
      maximumDate - maximum date
      Returns:
      value axis
    • getMinimumDate

      public Date getMinimumDate()
      Returns:
      minimum date of the axis
    • setMinimumDate

      @StudioProperty public ValueAxis setMinimumDate(Date minimumDate)
      Sets minimum date of the axis, if your value axis is date-based.
      Parameters:
      minimumDate - minimum date
      Returns:
      value axis
    • getPointPosition

      public PointPosition 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

      public Boolean getStrictMinMax()
      Returns:
      true if the chart doesn't adjust minimum and maximum of value axis
    • setStrictMinMax

      @StudioProperty(defaultValue="false") public ValueAxis 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. 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

      public ValueAxisType getType()
      Returns:
      type of value axis
    • setType

      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

      public Double 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

      public Double getAxisFrequency()
      Returns:
      axis frequency
    • setAxisFrequency

      @StudioProperty(defaultValue="1") public ValueAxis setAxisFrequency(Double axisFrequency)
      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

      public JsFunction getBalloonTextFunction()
      Returns:
      JS function to format balloon text of the axis
    • setBalloonTextFunction

      public ValueAxis setBalloonTextFunction(JsFunction balloonTextFunction)
      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

      public Boolean getAutoWrap()
      Returns:
      true if autoWrap is enabled
    • setAutoWrap

      @StudioProperty(defaultValue="false") public void setAutoWrap(Boolean autoWrap)
      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

      public DatePeriod 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