Class SparklineExpression
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.ColumnAggregationExpression
-
- org.pentaho.reporting.engine.classic.extensions.modules.sparklines.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 Summary
Fields Modifier and Type Field Description static Color
DEFAULT_COLOR
static Color
DEFAULT_HIGH_COLOR
static Color
DEFAULT_LAST_COLOR
static Color
DEFAULT_LOW_COLOR
static Color
DEFAULT_MEDIUM_COLOR
-
Constructor Summary
Constructors Constructor Description SparklineExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getBackgroundColor()
Color
getColor()
protected Number[]
getData()
Color
getHighColor()
Returns the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)Double
getHighSlice()
Returns the percentage from which to end the higher slice (for pie graphs).Color
getLastColor()
Returns the color of the last bar (for bar graphs).Color
getLowColor()
Returns the color for the lower slice (for pie graphs)Double
getLowSlice()
Returns the percentage from which to end the lower slice (for pie graphs).Color
getMediumColor()
Returns the color for the medium slice (for pie graphs)Double
getMediumSlice()
Returns the percentage from which to end the medium slice (for pie graphs).String
getRawDataField()
int
getSpacing()
Returns the spacing between each datapoint.int
getStartAngle()
Returns the angle from which the graph should start drawing (for pie graphs).String
getType()
Object
getValue()
Return the current expression value.boolean
isCounterClockWise()
Returns if the graph should be drawn in counter clockwise or not (for pie graphs).void
setBackgroundColor(Color backgroundColor)
void
setColor(Color color)
void
setCounterClockWise(boolean counterClockWise)
Sets the graph drawing orientation (for pie graphs).void
setHighColor(Color highColor)
Sets the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)void
setHighSlice(Double highSlice)
Sets the percentage from which to end the higher slice (for pie graphs).void
setLastColor(Color lastColor)
Sets the color of the last bar (for bar graphs)void
setLowColor(Color lowColor)
Sets the color for the lower slice (for pie graphs)void
setLowSlice(Double lowSlice)
Sets the percentage from which to end the lower slice (for pie graphs).void
setMediumColor(Color mediumColor)
Sets the color for the medium slice (for pie graphs)void
setMediumSlice(Double mediumSlice)
Sets the percentage from which to end the medium slice (for pie graphs).void
setRawDataField(String rawDataField)
void
setSpacing(int spacing)
Sets the spacing between each datapoint.void
setStartAngle(int startAngle)
Sets the angle from which the graph should start drawing (for pie graphs).void
setType(String type)
Type can be either "bar", "line" or "pie".-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.ColumnAggregationExpression
getField, getField, getFieldCount, getFieldValues, getInstance, setField, setField
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
-
-
-
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
-
-
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()
-
-