Package 

Class LimitRange


  • 
    public class LimitRange
    extends ComponentBase
                        

    The limit line is an additional feature for all Line-, Bar- and ScatterCharts. It allows the displaying of an additional line in the chart that marks a certain maximum / limit on the specified axis (x- or y-axis).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class LimitRange.Range
    • Constructor Summary

      Constructors 
      Constructor Description
      LimitRange(float firstLimit, float secondLimit) Constructor with limit.
      LimitRange(float firstLimit, float secondLimit, String label) Constructor with limit and label.
    • Method Summary

      Modifier and Type Method Description
      LimitRange.Range getLimit() Returns the limit that is set for this line.
      void setLineWidth(float width) set the line width of the chart (min = 0.
      float getLineWidth() returns the width of limit line
      void setLineColor(int color) Sets the linecolor for this LimitLine.
      void setRangeColor(int color) Sets the range color for this LimitRange.
      int getLineColor() Returns the color that is used for this LimitLine
      int getRangeColor() Returns the color that is used for this LimitRange
      void enableDashedLine(float lineLength, float spaceLength, float phase) Enables the line to be drawn in dashed mode, e.g.
      void disableDashedLine() Disables the line to be drawn in dashed mode.
      boolean isDashedLineEnabled() Returns true if the dashed-line effect is enabled, false if not.
      DashPathEffect getDashPathEffect() returns the DashPathEffect that is set for this LimitLine
      void setTextStyle(Paint.Style style) Sets the color of the value-text that is drawn next to the LimitLine.Default: Paint.Style.
      Paint.Style getTextStyle() Returns the color of the value-text that is drawn next to the LimitLine.
      void setLabelPosition(LimitLine.LimitLabelPosition pos) Sets the position of the LimitLine value label (either on the right or onthe left edge of the chart).
      LimitLine.LimitLabelPosition getLabelPosition() Returns the position of the LimitLine label (value).
      void setLabel(String label) Sets the label that is drawn next to the limit line.
      String getLabel() Returns the label that is drawn next to the limit line.
      • 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
    • Constructor Detail

      • LimitRange

        LimitRange(float firstLimit, float secondLimit)
        Constructor with limit.
        Parameters:
        firstLimit - - the position (the value) on the y-axis (y-value) or x-axis(xIndex) where this line should appear
        secondLimit - - the position (the value) on the y-axis (y-value) or x-axis(xIndex) where this line should appear
      • LimitRange

        LimitRange(float firstLimit, float secondLimit, String label)
        Constructor with limit and label.
        Parameters:
        firstLimit - - the position (the value) on the y-axis (y-value) or x-axis(xIndex) where this line should appear
        secondLimit - - the position (the value) on the y-axis (y-value) or x-axis(xIndex) where this line should appear
        label - - provide "" if no label is required
    • Method Detail

      • setLineWidth

         void setLineWidth(float width)

        set the line width of the chart (min = 0.2f, max = 12f); default 2f NOTE:thinner line == better performance, thicker line == worse performance

      • getLineWidth

         float getLineWidth()

        returns the width of limit line

      • setLineColor

         void setLineColor(int color)

        Sets the linecolor for this LimitLine. Make sure to usegetResources().getColor(...)

      • setRangeColor

         void setRangeColor(int color)

        Sets the range color for this LimitRange. Make sure to usegetResources().getColor(...)

      • getLineColor

         int getLineColor()

        Returns the color that is used for this LimitLine

      • getRangeColor

         int getRangeColor()

        Returns the color that is used for this LimitRange

      • enableDashedLine

         void enableDashedLine(float lineLength, float spaceLength, float phase)

        Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -"

        Parameters:
        lineLength - the length of the line pieces
        spaceLength - the length of space inbetween the pieces
        phase - offset, in degrees (normally, use 0)
      • disableDashedLine

         void disableDashedLine()

        Disables the line to be drawn in dashed mode.

      • isDashedLineEnabled

         boolean isDashedLineEnabled()

        Returns true if the dashed-line effect is enabled, false if not. Default:disabled

      • setTextStyle

         void setTextStyle(Paint.Style style)

        Sets the color of the value-text that is drawn next to the LimitLine.Default: Paint.Style.FILL_AND_STROKE

      • setLabel

         void setLabel(String label)

        Sets the label that is drawn next to the limit line. Provide "" if nolabel is required.

      • getLabel

         String getLabel()

        Returns the label that is drawn next to the limit line.