Class SparklineExpression

  • All Implemented Interfaces:
    Serializable, Cloneable, org.pentaho.reporting.engine.classic.core.function.Expression

    public class SparklineExpression
    extends org.pentaho.reporting.engine.classic.core.function.ColumnAggregationExpression
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_COLOR

        public static final Color DEFAULT_COLOR
      • DEFAULT_HIGH_COLOR

        public static final Color DEFAULT_HIGH_COLOR
      • DEFAULT_MEDIUM_COLOR

        public static final Color DEFAULT_MEDIUM_COLOR
      • DEFAULT_LOW_COLOR

        public static final Color DEFAULT_LOW_COLOR
      • DEFAULT_LAST_COLOR

        public static final Color DEFAULT_LAST_COLOR
    • Constructor Detail

      • SparklineExpression

        public SparklineExpression()
    • Method Detail

      • getType

        public String getType()
      • setType

        public void setType​(String type)
        Type can be either "bar", "line" or "pie".
        Parameters:
        type -
      • getRawDataField

        public String getRawDataField()
      • setRawDataField

        public void setRawDataField​(String rawDataField)
      • getColor

        public Color getColor()
      • setColor

        public void setColor​(Color color)
      • getBackgroundColor

        public Color getBackgroundColor()
      • setBackgroundColor

        public void setBackgroundColor​(Color backgroundColor)
      • getHighColor

        public Color getHighColor()
        Returns the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)
        Returns:
        The High bar/slice color.
      • setHighColor

        public void setHighColor​(Color highColor)
        Sets the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)
        Parameters:
        highColor - The color to use.
      • getLastColor

        public Color getLastColor()
        Returns the color of the last bar (for bar graphs).
        Returns:
        The last bar color
      • setLastColor

        public void setLastColor​(Color lastColor)
        Sets the color of the last bar (for bar graphs)
        Parameters:
        lastColor - The color to use.
      • getMediumColor

        public Color getMediumColor()
        Returns the color for the medium slice (for pie graphs)
        Returns:
        The Medium color.
      • setMediumColor

        public void setMediumColor​(Color mediumColor)
        Sets the color for the medium slice (for pie graphs)
        Parameters:
        mediumColor - The color to use.
      • getLowColor

        public Color getLowColor()
        Returns the color for the lower slice (for pie graphs)
        Returns:
        The Low color.
      • setLowColor

        public void setLowColor​(Color lowColor)
        Sets the color for the lower slice (for pie graphs)
        Parameters:
        lowColor - The color to use.
      • getHighSlice

        public Double getHighSlice()
        Returns the percentage from which to end the higher slice (for pie graphs). It should be "1.0".
        Returns:
        The slice percentage
      • setHighSlice

        public void setHighSlice​(Double highSlice)
        Sets the percentage from which to end the higher slice (for pie graphs). It should be "1.0".
        Parameters:
        highSlice - The begin in percentage.
      • getMediumSlice

        public Double getMediumSlice()
        Returns the percentage from which to end the medium slice (for pie graphs).
        Returns:
        The slice percentage
      • setMediumSlice

        public void setMediumSlice​(Double mediumSlice)
        Sets the percentage from which to end the medium slice (for pie graphs).
        Parameters:
        mediumSlice - The begin in percentage.
      • getLowSlice

        public Double getLowSlice()
        Returns the percentage from which to end the lower slice (for pie graphs).
        Returns:
        The slice percentage
      • setLowSlice

        public void setLowSlice​(Double lowSlice)
        Sets the percentage from which to end the lower slice (for pie graphs).
        Parameters:
        lowSlice - The begin in percentage.
      • isCounterClockWise

        public boolean isCounterClockWise()
        Returns if the graph should be drawn in counter clockwise or not (for pie graphs).
        Returns:
        true if counter clockwise or false.
      • setCounterClockWise

        public void setCounterClockWise​(boolean counterClockWise)
        Sets the graph drawing orientation (for pie graphs). true means counter clockwise.
        Parameters:
        counterClockWise - The new clockwise value.
      • getStartAngle

        public int getStartAngle()
        Returns the angle from which the graph should start drawing (for pie graphs). 0 means 12 o'clock.
        Returns:
        The angle in degrees.
      • setStartAngle

        public void setStartAngle​(int startAngle)
        Sets the angle from which the graph should start drawing (for pie graphs). 0 means 12 o'clock.
        Parameters:
        startAngle - The new angle in degrees.
      • getSpacing

        public int getSpacing()
        Returns the spacing between each datapoint.
        Returns:
        The spacing.
      • setSpacing

        public void setSpacing​(int spacing)
        Sets the spacing between each datapoint.
        Parameters:
        spacing - The new spacing value to use.
      • getValue

        public Object getValue()
        Return the current expression value.

        The value depends (obviously) on the expression implementation.

        Returns:
        the value of the function.
      • getData

        protected Number[] getData()