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

public abstract class AbstractAxis<T extends AbstractAxis> extends AbstractChartObject
Base class for ValueAxis and CategoryAxis.
See documentation for properties of AxisBase JS Object.
http://docs.amcharts.com/3/javascriptcharts/AxisBase
See Also:
  • Constructor Details

    • AbstractAxis

      public AbstractAxis()
  • Method Details

    • getAutoGridCount

      public Boolean getAutoGridCount()
      Returns:
      true if number of gridCount is specified automatically, according to the axis size
    • setAutoGridCount

      @StudioProperty(defaultValue="true") public T 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. If not set the default value is true.
      Parameters:
      autoGridCount - auto grid count option
      Returns:
      axis
    • getAxisAlpha

      public Double getAxisAlpha()
      Returns:
      axis opacity
    • setAxisAlpha

      @StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public T setAxisAlpha(Double axisAlpha)
      Sets axis opacity. Value range is 0 - 1. If not set the default value is 1.
      Parameters:
      axisAlpha - axis opacity
      Returns:
      axis
    • getAxisColor

      public Color getAxisColor()
      Returns:
      axis color
    • setAxisColor

      @StudioProperty(type=OPTIONS, defaultValue="#000000") public T setAxisColor(Color axisColor)
      Sets axis color. If not set the default value is #000000.
      Parameters:
      axisColor - axis color
      Returns:
      axis
    • getAxisThickness

      public Integer getAxisThickness()
      Returns:
      thickness of the axis
    • setAxisThickness

      @StudioProperty(defaultValue="1") public T setAxisThickness(Integer axisThickness)
      Sets thickness of the axis. If not set the default value is 1.
      Parameters:
      axisThickness - thickness of the axis
      Returns:
      axis
    • getColor

      public Color getColor()
      Returns:
      color of axis value labels
    • setColor

      @StudioProperty(type=OPTIONS) public T setColor(Color color)
      Sets color of axis value labels. Will use chart's color if not set.
      Parameters:
      color - color of axis value labels
      Returns:
      axis
    • getDashLength

      public Integer getDashLength()
      Returns:
      length of a dash
    • setDashLength

      @StudioProperty(defaultValue="0") public T setDashLength(Integer dashLength)
      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

      public Double getFillAlpha()
      Returns:
      fill opacity
    • setFillAlpha

      @StudioProperty @Max(1L) @Min(0L) public T setFillAlpha(Double fillAlpha)
      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

      public Color getFillColor()
      Returns:
      fill color
    • setFillColor

      @StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") public T setFillColor(Color fillColor)
      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

      public Integer getFontSize()
      Returns:
      size of value labels text
    • setFontSize

      @StudioProperty public T setFontSize(Integer fontSize)
      Sets size of value labels text. Will use chart's fontSize if not set.
      Parameters:
      fontSize - size of value labels text
      Returns:
      axis
    • getGridAlpha

      public Double getGridAlpha()
      Returns:
      opacity of grid lines
    • setGridAlpha

      @StudioProperty(defaultValue="0.15") @Max(1L) @Min(0L) public T setGridAlpha(Double gridAlpha)
      Sets opacity of grid lines. If not set the default value is 0.15.
      Parameters:
      gridAlpha - opacity of grid lines
      Returns:
      axis
    • getGridColor

      public Color getGridColor()
      Returns:
      color of grid lines
    • setGridColor

      @StudioProperty(type=OPTIONS, defaultValue="#000000") public T setGridColor(Color gridColor)
      Sets color of grid lines. If not set the default value is #000000
      Parameters:
      gridColor - color of grid lines
      Returns:
      axis
    • getGridCount

      public Integer getGridCount()
      Returns:
      number of grid lines
    • setGridCount

      @StudioProperty(defaultValue="5") public T setGridCount(Integer gridCount)
      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

      public Integer getGridThickness()
      Returns:
      thickness of grid lines
    • setGridThickness

      @StudioProperty(defaultValue="1") public T setGridThickness(Integer gridThickness)
      Sets thickness of grid lines. If not set the default value is 1.
      Parameters:
      gridThickness - thickness of grid lines
      Returns:
      axis
    • getGuides

      public List<Guide> getGuides()
      Returns:
      list of guides
    • setGuides

      @StudioElementsGroup(caption="Guides", xmlElement="guides") public T setGuides(List<Guide> guides)
      Sets list of guides belonging to this axis
      Parameters:
      guides - list of guides
      Returns:
      axis
    • addGuides

      public T addGuides(Guide... guides)
      Adds guides.
      Parameters:
      guides - guides
      Returns:
      axis
    • getIgnoreAxisWidth

      public Boolean getIgnoreAxisWidth()
      Returns:
      true if the axis isn't be measured when calculating margin.
    • setIgnoreAxisWidth

      @StudioProperty(defaultValue="false") public T setIgnoreAxisWidth(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. If not set the default value is false.
      Parameters:
      ignoreAxisWidth - ignoreAxisWidth option
      Returns:
      axis
    • getInside

      public Boolean getInside()
      Returns:
      true if values placed inside of plot area
    • setInside

      @StudioProperty(defaultValue="false") public T setInside(Boolean inside)
      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

      public Double getLabelFrequency()
      Returns:
      frequency at which labels should be placed
    • setLabelFrequency

      @StudioProperty(defaultValue="1") public T setLabelFrequency(Double labelFrequency)
      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

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

      public Boolean getLabelsEnabled()
      Returns:
      true if axis displays category axis labels and value axis values.
    • setLabelsEnabled

      @StudioProperty(defaultValue="true") public T setLabelsEnabled(Boolean labelsEnabled)
      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

      public Integer getMinHorizontalGap()
      Returns:
      minimum cell width required for one span between grid lines
    • setMinHorizontalGap

      @StudioProperty(defaultValue="75") public T setMinHorizontalGap(Integer minHorizontalGap)
      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

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

      public Boolean getMinorGridEnabled()
      Returns:
      true if minor grid is displayed
    • setMinorGridEnabled

      @StudioProperty(defaultValue="false") public T setMinorGridEnabled(Boolean minorGridEnabled)
      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

      public Integer getMinVerticalGap()
      Returns:
      minimum cell height required for one span between grid lines
    • setMinVerticalGap

      @StudioProperty(defaultValue="35") public T setMinVerticalGap(Integer minVerticalGap)
      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

      public Integer getOffset()
      Returns:
      the distance of the axis to the plot area, in pixels
    • setOffset

      @StudioProperty(defaultValue="0") public T setOffset(Integer offset)
      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

      public Position getPosition()
      Returns:
      position
    • setPosition

      @StudioProperty(type=ENUMERATION, defaultValue="BOTTOM") public T setPosition(Position position)
      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

      public Boolean getShowFirstLabel()
      Returns:
      true if first axis label is shown
    • setShowFirstLabel

      @StudioProperty(defaultValue="true") public T setShowFirstLabel(Boolean showFirstLabel)
      Set showFirstLabel to false if you don't want to show first axis label. This works properly only on ValueAxis. With CategoryAxis 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

      public Boolean getShowLastLabel()
      Returns:
      true if last axis label is shown
    • setShowLastLabel

      @StudioProperty(defaultValue="true") public T setShowLastLabel(Boolean showLastLabel)
      Set showFirstLabel to false if you don't want to show last axis label. This works properly only on ValueAxis. With CategoryAxis 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

      public Integer getTickLength()
      Returns:
      length of the tick marks
    • setTickLength

      @StudioProperty(defaultValue="5") public T setTickLength(Integer tickLength)
      Sets length of the tick marks. If not set the default value is 5.
      Parameters:
      tickLength - length of the tick marks
      Returns:
      axis
    • getTitle

      public String getTitle()
      Returns:
      title of the axis
    • setTitle

      @StudioProperty public T setTitle(String title)
      Sets title of the axis.
      Parameters:
      title - title of the axis
      Returns:
      axis
    • getTitleBold

      public Boolean getTitleBold()
      Returns:
      true if title is bold
    • setTitleBold

      @StudioProperty(defaultValue="true") public T setTitleBold(Boolean titleBold)
      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

      public Color getTitleColor()
      Returns:
      color of axis title
    • setTitleColor

      @StudioProperty(type=OPTIONS) public T setTitleColor(Color titleColor)
      Sets color of axis title. Will use text color of chart if not set any.
      Parameters:
      titleColor - color of axis title
      Returns:
      axis
    • getTitleFontSize

      public Integer getTitleFontSize()
      Returns:
      font size of axis title
    • setTitleFontSize

      @StudioProperty public T setTitleFontSize(Integer titleFontSize)
      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

      public Boolean getBoldLabels()
      Returns:
      true if axis labels are bold.
    • setBoldLabels

      @StudioProperty(defaultValue="false") public T setBoldLabels(Boolean boldLabels)
      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

      public Integer getAutoRotateAngle()
      Returns:
      angle of label rotation
    • setAutoRotateAngle

      @StudioProperty public T setAutoRotateAngle(Integer autoRotateAngle)
      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

      public Integer getAutoRotateCount()
      Returns:
      auto rotate count
    • setAutoRotateCount

      @StudioProperty public T setAutoRotateCount(Integer autoRotateCount)
      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

      public Boolean getCenterLabels()
      Returns:
      true if labels of the date-based axis is centered
    • setCenterLabels

      @StudioProperty(defaultValue="false") public T 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). If not set the default value is false.
      Parameters:
      centerLabels - center labels option
      Returns:
      axis
    • getDateFormats

      public List<DateFormat> getDateFormats()
      Returns:
      list of date formats of different periods
    • setDateFormats

      public T setDateFormats(List<DateFormat> dateFormats)
      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

      public T addDateFormats(DateFormat... dateFormats)
      Adds date formats.
      Parameters:
      dateFormats - date formats
      Returns:
      axis
    • getMinorTickLength

      public Integer getMinorTickLength()
      Returns:
      length of minor grid tick
    • setMinorTickLength

      @StudioProperty(defaultValue="0") public T setMinorTickLength(Integer minorTickLength)
      Sets length of minor grid tick. If not set the default value is 0.
      Parameters:
      minorTickLength - length of minor grid tick
      Returns:
      axis
    • getTitleRotation

      public Integer getTitleRotation()
      Returns:
      rotation of axis title
    • setTitleRotation

      @StudioProperty public T setTitleRotation(Integer titleRotation)
      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

      public Balloon getBalloon()
      Returns:
      balloon
    • setBalloon

      public T setBalloon(Balloon balloon)
      Sets balloon to the axis.
      Parameters:
      balloon - balloon
      Returns:
      axis
    • getBoldPeriodBeginning

      public Boolean getBoldPeriodBeginning()
      Returns:
      true if chart highlights the beginning of the periods in bold
    • setBoldPeriodBeginning

      @StudioProperty(defaultValue="true") public T 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. If not set the default value is true.
      Parameters:
      boldPeriodBeginning - boldPeriodBeginning option
      Returns:
      axis
    • getCenterLabelOnFullPeriod

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

      public DayOfWeek getFirstDayOfWeek()
      Returns:
      first day of the week
    • setFirstDayOfWeek

      public T setFirstDayOfWeek(DayOfWeek firstDayOfWeek)
      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

      public Integer getLabelOffset()
      Returns:
      offset of axes labels
    • setLabelOffset

      @StudioProperty(defaultValue="0") public T setLabelOffset(Integer labelOffset)
      Sets offset of axes labels. Works both with CategoryAxis and ValueAxis. If not set the default value is 0.
      Parameters:
      labelOffset - offset of axes labels
      Returns:
      axis
    • getMarkPeriodChange

      public Boolean getMarkPeriodChange()
      Returns:
      true if the start of longer periods uses a different date
    • setMarkPeriodChange

      @StudioProperty(defaultValue="true") public T 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. If not set the default value is true.
      Parameters:
      markPeriodChange - markPeriodChange option
      Returns:
      axis
    • getCenterRotatedLabels

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