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 ColorDEFAULT_COLORstatic ColorDEFAULT_HIGH_COLORstatic ColorDEFAULT_LAST_COLORstatic ColorDEFAULT_LOW_COLORstatic ColorDEFAULT_MEDIUM_COLOR
-
Constructor Summary
Constructors Constructor Description SparklineExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetBackgroundColor()ColorgetColor()protected Number[]getData()ColorgetHighColor()Returns the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)DoublegetHighSlice()Returns the percentage from which to end the higher slice (for pie graphs).ColorgetLastColor()Returns the color of the last bar (for bar graphs).ColorgetLowColor()Returns the color for the lower slice (for pie graphs)DoublegetLowSlice()Returns the percentage from which to end the lower slice (for pie graphs).ColorgetMediumColor()Returns the color for the medium slice (for pie graphs)DoublegetMediumSlice()Returns the percentage from which to end the medium slice (for pie graphs).StringgetRawDataField()intgetSpacing()Returns the spacing between each datapoint.intgetStartAngle()Returns the angle from which the graph should start drawing (for pie graphs).StringgetType()ObjectgetValue()Return the current expression value.booleanisCounterClockWise()Returns if the graph should be drawn in counter clockwise or not (for pie graphs).voidsetBackgroundColor(Color backgroundColor)voidsetColor(Color color)voidsetCounterClockWise(boolean counterClockWise)Sets the graph drawing orientation (for pie graphs).voidsetHighColor(Color highColor)Sets the color for the highest bars (for bar graphs) or the color for the highest slice (for pie graphs)voidsetHighSlice(Double highSlice)Sets the percentage from which to end the higher slice (for pie graphs).voidsetLastColor(Color lastColor)Sets the color of the last bar (for bar graphs)voidsetLowColor(Color lowColor)Sets the color for the lower slice (for pie graphs)voidsetLowSlice(Double lowSlice)Sets the percentage from which to end the lower slice (for pie graphs).voidsetMediumColor(Color mediumColor)Sets the color for the medium slice (for pie graphs)voidsetMediumSlice(Double mediumSlice)Sets the percentage from which to end the medium slice (for pie graphs).voidsetRawDataField(String rawDataField)voidsetSpacing(int spacing)Sets the spacing between each datapoint.voidsetStartAngle(int startAngle)Sets the angle from which the graph should start drawing (for pie graphs).voidsetType(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).truemeans 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()
-
-