Package 

Class YAxis


  • 
    public class YAxis
    extends AxisBase
                        

    Class representing the y-axis labels settings and its entries. Only use the setter methods to modify it. Do not access public variables directly. Be aware that not all features the YLabels class provides are suitable for the RadarChart. Customizations that affect the value range of the axis need to be applied before setting data for the chart.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum YAxis.YAxisLabelPosition

      enum for the position of the y-labels relative to the chart

      public enum YAxis.AxisDependency

      Enum that specifies the axis a DataSet should be plotted against, either LEFT or RIGHT.

    • Method Summary

      Modifier and Type Method Description
      YAxis.AxisDependency getAxisDependency()
      float getMinWidth()
      void setMinWidth(float minWidth) Sets the minimum width that the axis should take (in dp).
      float getMaxWidth()
      void setMaxWidth(float maxWidth) Sets the maximum width that the axis can take (in dp).
      YAxis.YAxisLabelPosition getLabelPosition() returns the position of the y-labels
      void setPosition(YAxis.YAxisLabelPosition pos) sets the position of the y-labels
      float getLabelXOffset() returns the horizontal offset of the y-label
      void setLabelXOffset(float xOffset) sets the horizontal offset of the y-label
      boolean isDrawTopYLabelEntryEnabled() returns true if drawing the top y-axis label entry is enabled
      boolean isDrawBottomYLabelEntryEnabled() returns true if drawing the bottom y-axis label entry is enabled
      void setDrawTopYLabelEntry(boolean enabled) set this to true to enable drawing the top y-label entry.
      void setInverted(boolean enabled) If this is set to true, the y-axis is inverted which means that low values are on top ofthe chart, high valueson bottom.
      boolean isInverted() If this returns true, the y-axis is inverted.
      void setStartAtZero(boolean startAtZero) This method is deprecated.Use setAxisMinimum(...) / setAxisMaximum(...) instead.
      void setSpaceTop(float percent) Sets the top axis space in percent of the full range.
      float getSpaceTop() Returns the top axis space in percent of the full range.
      void setSpaceBottom(float percent) Sets the bottom axis space in percent of the full range.
      float getSpaceBottom() Returns the bottom axis space in percent of the full range.
      boolean isDrawZeroLineEnabled()
      void setDrawZeroLine(boolean mDrawZeroLine) Set this to true to draw the zero-line regardless of weather othergrid-lines are enabled or not.
      int getZeroLineColor()
      void setZeroLineColor(int color) Sets the color of the zero line
      float getZeroLineWidth()
      void setZeroLineWidth(float width) Sets the width of the zero line in dp
      float getRequiredWidthSpace(Paint p) This is for normal (not horizontal) charts horizontal spacing.
      float getRequiredHeightSpace(Paint p) This is for HorizontalBarChart vertical spacing.
      boolean needsOffset() Returns true if this axis needs horizontal offset, false if no offset is needed.
      boolean isUseAutoScaleMinRestriction() Returns true if autoscale restriction for axis min value is enabled
      void setUseAutoScaleMinRestriction(boolean isEnabled) Sets autoscale restriction for axis min value as enabled/disabled
      boolean isUseAutoScaleMaxRestriction() Returns true if autoscale restriction for axis max value is enabled
      void setUseAutoScaleMaxRestriction(boolean isEnabled) Sets autoscale restriction for axis max value as enabled/disabled
      void calculate(float dataMin, float dataMax) Calculates the minimum / maximum and range values of the axis with the givenminimum and maximum values from the chart data.
      • Methods inherited from class com.github.mikephil.charting.components.AxisBase

        addLimitLine, addLimitRange, disableAxisLineDashedLine, disableGridDashedLine, enableAxisLineDashedLine, enableGridDashedLine, getAxisLineColor, getAxisLineDashPathEffect, getAxisLineWidth, getAxisMaxLabels, getAxisMaximum, getAxisMinLabels, getAxisMinimum, getFormattedLabel, getGranularity, getGridColor, getGridDashPathEffect, getGridLineWidth, getLabelCount, getLimitLines, getLimitRanges, getLongestLabel, getLongestLabel, getSpaceMax, getSpaceMin, getSpecificPositions, getValueFormatter, isAxisLineDashedLineEnabled, isAxisMaxCustom, isAxisMinCustom, isCenterAxisLabelsEnabled, isDrawAxisLineEnabled, isDrawGridLinesBehindDataEnabled, isDrawGridLinesEnabled, isDrawLabelsEnabled, isDrawLimitLinesBehindDataEnabled, isForceLabelsEnabled, isGranularityEnabled, isGridDashedLineEnabled, isShowSpecificPositions, removeAllLimitLines, removeAllLimitRanges, removeLimitLine, removeLimitRange, resetAxisMaximum, resetAxisMinimum, setAxisLineColor, setAxisLineDashedLine, setAxisLineWidth, setAxisMaxLabels, setAxisMaxValue, setAxisMaximum, setAxisMinLabels, setAxisMinValue, setAxisMinimum, setCenterAxisLabels, setDrawAxisLine, setDrawGridLines, setDrawGridLinesBehindData, setDrawLabels, setDrawLimitLinesBehindData, setGranularity, setGranularityEnabled, setGridColor, setGridDashedLine, setGridLineWidth, setLabelCount, setLabelCount, setShowSpecificPositions, setSpaceMax, setSpaceMin, setSpecificPositions, setTextColor, setValueFormatter
      • Methods inherited from class com.github.mikephil.charting.components.ComponentBase

        getTextColor, getTextSize, getTypeface, getXOffset, getYOffset, isEnabled, setEnabled, setTextColor, setTextSize, setTypeface, setXOffset, setYOffset
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setMinWidth

         void setMinWidth(float minWidth)

        Sets the minimum width that the axis should take (in dp).

      • setMaxWidth

         void setMaxWidth(float maxWidth)

        Sets the maximum width that the axis can take (in dp).

      • getLabelXOffset

         float getLabelXOffset()

        returns the horizontal offset of the y-label

      • setLabelXOffset

         void setLabelXOffset(float xOffset)

        sets the horizontal offset of the y-label

      • setDrawTopYLabelEntry

         void setDrawTopYLabelEntry(boolean enabled)

        set this to true to enable drawing the top y-label entry. Disabling this can be helpfulwhen the top y-label andleft x-label interfere with each other. default: true

      • setInverted

         void setInverted(boolean enabled)

        If this is set to true, the y-axis is inverted which means that low values are on top ofthe chart, high valueson bottom.

      • isInverted

         boolean isInverted()

        If this returns true, the y-axis is inverted.

      • setStartAtZero

        @Deprecated() void setStartAtZero(boolean startAtZero)

        This method is deprecated.Use setAxisMinimum(...) / setAxisMaximum(...) instead.

      • setSpaceTop

         void setSpaceTop(float percent)

        Sets the top axis space in percent of the full range. Default 10f

      • getSpaceTop

         float getSpaceTop()

        Returns the top axis space in percent of the full range. Default 10f

      • setSpaceBottom

         void setSpaceBottom(float percent)

        Sets the bottom axis space in percent of the full range. Default 10f

      • getSpaceBottom

         float getSpaceBottom()

        Returns the bottom axis space in percent of the full range. Default 10f

      • setDrawZeroLine

         void setDrawZeroLine(boolean mDrawZeroLine)

        Set this to true to draw the zero-line regardless of weather othergrid-lines are enabled or not. Default: false

      • setZeroLineColor

         void setZeroLineColor(int color)

        Sets the color of the zero line

      • setZeroLineWidth

         void setZeroLineWidth(float width)

        Sets the width of the zero line in dp

      • needsOffset

         boolean needsOffset()

        Returns true if this axis needs horizontal offset, false if no offset is needed.

      • calculate

         void calculate(float dataMin, float dataMax)

        Calculates the minimum / maximum and range values of the axis with the givenminimum and maximum values from the chart data.

        Parameters:
        dataMin - the min value according to chart data
        dataMax - the max value according to chart data