Class CategoricalChartExpression
java.lang.Object
org.pentaho.reporting.engine.classic.core.function.AbstractExpression
org.pentaho.plugin.jfreereport.reportcharts.AbstractChartExpression
org.pentaho.plugin.jfreereport.reportcharts.CategoricalChartExpression
- All Implemented Interfaces:
Serializable,Cloneable,ChartExpression,org.pentaho.reporting.engine.classic.core.DynamicExpression,org.pentaho.reporting.engine.classic.core.function.Expression,org.pentaho.reporting.engine.classic.core.LegacyUpdateHandler
- Direct Known Subclasses:
LineChartExpression,StackedCategoricalChartExpression,WaterfallChartExpressions
public abstract class CategoricalChartExpression
extends AbstractChartExpression
implements org.pentaho.reporting.engine.classic.core.LegacyUpdateHandler
This class allows you to embed categorical charts into JFreeReport XML definitions.
- Author:
- mbatchel
- See Also:
-
Field Summary
Fields inherited from class org.pentaho.plugin.jfreereport.reportcharts.AbstractChartExpression
EMPTY_STROKE, LINE_STYLE_DASH_STR, LINE_STYLE_DASHDOT_STR, LINE_STYLE_DASHDOTDOT_STR, LINE_STYLE_DOT_STR, LINE_STYLE_SOLID_STR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.jfree.chart.JFreeChartcomputeCategoryChart(org.jfree.data.category.CategoryDataset dataset) protected org.jfree.chart.JFreeChartcomputeChart(org.jfree.data.general.Dataset dataset) protected org.jfree.chart.plot.PlotOrientationprotected voidconfigureChart(org.jfree.chart.JFreeChart chart) protected voidconfigureLogarithmicAxis(org.jfree.chart.plot.CategoryPlot plot) protected voidconfigureRangeAxis(org.jfree.chart.plot.CategoryPlot cpl, Font labelFont) protected org.jfree.chart.axis.CategoryLabelPositioncreateUpRotationCategoryLabelPosition(org.pentaho.plugin.jfreereport.reportcharts.CategoricalChartExpression.PlaneDirection axisPosition, double labelAngle) Used instead oforg.jfree.chart.axis.CategoryLabelPosition.createUpRotationLabelPositions.org.jfree.chart.JFreeChartgetChart(org.jfree.data.category.CategoryDataset categoryDataset) Deprecated.should not be public and should not be a getter.protected intgetDateUnitAsInt(Class domainTimePeriod) org.pentaho.reporting.engine.classic.core.function.ExpressionReturn a completly separated copy of this function.doubleReturn the range axis' maximum valuedoubleReturn the range axis' minimum valuedoubleReturn the java.awt.Font to be used to display the range axis tick labelsdoubleprotected org.pentaho.plugin.jfreereport.reportcharts.CategoricalChartExpression.PlaneDirectiongetTextAnchorDirectionOfAngle(double angle) Chooses a proper anchor for a text label at a chart axis tick.booleanbooleanbooleanbooleanbooleanbooleanbooleanvoidreconfigureForCompatibility(int versionTag) voidsetAutoRange(boolean autoRange) voidsetCategoricalAxisMessageFormat(String categoricalAxisMessageFormat) voidvoidvoidvoidvoidsetCategoricalLabelFormat(String value) voidsetCategoryAxisLabel(String categoryAxisLabel) voidsetCategoryMargin(Double categoryMargin) voidsetCategoryTickFont(Font categoryTickFont) voidsetCategoryTitleFont(Font categoryTitleFont) voidsetHorizontal(boolean value) voidsetHumanReadableLogarithmicFormat(boolean humanReadableLogarithmicFormat) voidsetLabelRotation(Double value) voidsetLabelRotationDeg(Double value) voidsetLogarithmicAxis(boolean logarithmicAxis) voidsetLowerMargin(Double lowerMargin) voidvoidsetRangeIncludesZero(boolean rangeIncludesZero) voidsetRangeMaximum(double rangeMaximum) voidsetRangeMinimum(double rangeMinimum) voidsetRangePeriodCount(double rangePeriodCount) voidsetRangeStickyZero(boolean rangeStickyZero) voidsetRangeTickFont(Font rangeTickFont) voidsetRangeTickFormat(NumberFormat rangeTickFormat) voidsetRangeTickFormatString(String rangeTickFormatString) voidsetRangeTimePeriod(Class rangeTimePeriod) voidsetRangeTitleFont(Font rangeTitleFont) voidsetScaleFactor(double scaleFactor) voidsetShowGridlines(boolean value) voidsetUpperMargin(Double upperMargin) voidsetValueAxisLabel(String valueAxisLabel) Methods inherited from class org.pentaho.plugin.jfreereport.reportcharts.AbstractChartExpression
addExpression, computeTitle, getBackgroundColor, getBackgroundImage, getBorderColor, getChartDirectory, getChartFile, getChartFromCache, getChartHeight, getChartUrlMask, getChartWidth, getColorFromString, getDataSource, getDependencyLevel, getExpressionMap, getHyperlinkFormulas, getItemLabelFont, getItemsLabelVisible, getLabelFont, getLegendBackgroundColor, getLegendFont, getLegendLocation, getLegendTextColor, getNoDataMessage, getPlotBackgroundAlpha, getPlotBackgroundColor, getPlotForegroundAlpha, getPossibleExpressionStringValue, getPostProcessingLanguage, getPostProcessingScript, getSeriesColor, getSeriesColor, getSeriesColorCount, getSeriesColors, getTitle, getTitleField, getTitleFont, getTitleText, getTooltipFormula, getUrlFormula, getValue, isAntiAlias, isChartSectionOutline, isDrawLegendBorder, isReturnFileNameOnly, isReturnImageReference, isShowBorder, isShowLegend, isThreeD, isUseDrawable, loadChartFromCache, parseColorFromString, postProcessChart, putChartInCache, removeExpression, setAntiAlias, setBackgroundColor, setBackgroundImage, setBorderColor, setChartDirectory, setChartFile, setChartHeight, setChartSectionOutline, setChartUrlMask, setChartWidth, setDataSource, setDependencyLevel, setDrawLegendBorder, setExpressionMap, setItemLabelFont, setItemsLabelVisible, setLabelFont, setLegendBackgroundColor, setLegendFont, setLegendLocation, setLegendTextColor, setNoDataMessage, setPlotBackgroundAlpha, setPlotBackgroundColor, setPlotForegroundAlpha, setPostProcessingLanguage, setPostProcessingScript, setReturnFileNameOnly, setReturnImageReference, setSeriesColor, setSeriesColor, setShowBorder, setShowLegend, setThreeD, setTitle, setTitleField, setTitleFont, setTitleText, setTooltipFormula, setUrlFormula, setUseDrawable, standardTickUnitsApplyFormat, storeChartInCache, translateEdge, translateLineStyleMethods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setName, setPreserve, setRuntimeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setName, setRuntime
-
Constructor Details
-
CategoricalChartExpression
protected CategoricalChartExpression()
-
-
Method Details
-
getCategoryTitleFont
-
setCategoryTitleFont
-
getCategoryTickFont
-
setCategoryTickFont
-
getRangeTickFormatString
-
setRangeTickFormatString
-
getCategoricalAxisMessageFormat
-
setCategoricalAxisMessageFormat
-
getRangeTickFont
Return the java.awt.Font to be used to display the range axis tick labels- Returns:
- Font The Font for the range axis tick labels
-
setRangeTickFont
- Parameters:
rangeTickFont- The rangeTitleFont to set.
-
getRangeMinimum
public double getRangeMinimum()Return the range axis' minimum value- Returns:
- double Range axis' minimum value
-
setRangeMinimum
public void setRangeMinimum(double rangeMinimum) - Parameters:
rangeMinimum- Set the minimum value of the range axis.
-
getRangeMaximum
public double getRangeMaximum()Return the range axis' maximum value- Returns:
- double Range axis' maximum value
-
setRangeMaximum
public void setRangeMaximum(double rangeMaximum) - Parameters:
rangeMaximum- Set the maximum value of the range axis.
-
getRangeTitleFont
- Returns:
- Returns the rangeTitleFont.
-
setRangeTitleFont
- Parameters:
rangeTitleFont- The rangeTitleFont to set.
-
getRangeTickFormat
- Returns:
- Returns the rangeTickFormat.
-
setRangeTickFormat
- Parameters:
rangeTickFormat- The range tick number format to set.
-
isRangeIncludesZero
public boolean isRangeIncludesZero()- Returns:
- Returns the rangeIncludeZero.
-
setRangeIncludesZero
public void setRangeIncludesZero(boolean rangeIncludesZero) - Parameters:
rangeIncludesZero- The domainIncludesZero to set.
-
isRangeStickyZero
public boolean isRangeStickyZero()- Returns:
- Returns the rangeStickyZero.
-
setRangeStickyZero
public void setRangeStickyZero(boolean rangeStickyZero) - Parameters:
rangeStickyZero- The rangeStickyZero to set.
-
isLogarithmicAxis
public boolean isLogarithmicAxis() -
setLogarithmicAxis
public void setLogarithmicAxis(boolean logarithmicAxis) -
isHumanReadableLogarithmicFormat
public boolean isHumanReadableLogarithmicFormat() -
setHumanReadableLogarithmicFormat
public void setHumanReadableLogarithmicFormat(boolean humanReadableLogarithmicFormat) -
getLowerMargin
-
setLowerMargin
-
getUpperMargin
-
setUpperMargin
-
getCategoryMargin
-
setCategoryMargin
-
getLabelRotationDeg
-
setLabelRotationDeg
-
getLabelRotation
-
setLabelRotation
-
getCategoricalItemLabelRotationDeg
-
setCategoricalItemLabelRotationDeg
-
getCategoricalItemLabelRotation
-
setCategoricalItemLabelRotation
-
setMaxCategoryLabelWidthRatio
-
getMaxCategoryLabelWidthRatio
-
isShowGridlines
public boolean isShowGridlines() -
setShowGridlines
public void setShowGridlines(boolean value) -
isHorizontal
public boolean isHorizontal() -
setHorizontal
public void setHorizontal(boolean value) -
getValueAxisLabel
-
setValueAxisLabel
-
getCategoryAxisLabel
-
setCategoryAxisLabel
-
setCategoricalLabelFormat
-
getCategoricalLabelFormat
-
setCategoricalLabelDecimalFormat
-
getCategoricalLabelDecimalFormat
-
setCategoricalLabelDateFormat
-
getCategoricalLabelDateFormat
-
isAutoRange
public boolean isAutoRange() -
setAutoRange
public void setAutoRange(boolean autoRange) -
getScaleFactor
public double getScaleFactor() -
setScaleFactor
public void setScaleFactor(double scaleFactor) -
computeChart
protected org.jfree.chart.JFreeChart computeChart(org.jfree.data.general.Dataset dataset) - Overrides:
computeChartin classAbstractChartExpression
-
computeCategoryChart
protected org.jfree.chart.JFreeChart computeCategoryChart(org.jfree.data.category.CategoryDataset dataset) -
getChart
public org.jfree.chart.JFreeChart getChart(org.jfree.data.category.CategoryDataset categoryDataset) Deprecated.should not be public and should not be a getter. In fact. it will be removed in PRD-4.0- Parameters:
categoryDataset- the dataset.- Returns:
- the generated chart. This implementation returns null.
-
computePlotOrientation
protected org.jfree.chart.plot.PlotOrientation computePlotOrientation() -
configureChart
protected void configureChart(org.jfree.chart.JFreeChart chart) - Overrides:
configureChartin classAbstractChartExpression
-
configureRangeAxis
-
configureLogarithmicAxis
protected void configureLogarithmicAxis(org.jfree.chart.plot.CategoryPlot plot) -
getRangeTimePeriod
-
setRangeTimePeriod
-
getRangePeriodCount
public double getRangePeriodCount() -
setRangePeriodCount
public void setRangePeriodCount(double rangePeriodCount) -
getInstance
public org.pentaho.reporting.engine.classic.core.function.Expression getInstance()Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.- Specified by:
getInstancein interfaceorg.pentaho.reporting.engine.classic.core.function.Expression- Overrides:
getInstancein classAbstractChartExpression- Returns:
- a copy of this function.
-
getDateUnitAsInt
-
reconfigureForCompatibility
public void reconfigureForCompatibility(int versionTag) - Specified by:
reconfigureForCompatibilityin interfaceorg.pentaho.reporting.engine.classic.core.LegacyUpdateHandler
-
createUpRotationCategoryLabelPosition
protected org.jfree.chart.axis.CategoryLabelPosition createUpRotationCategoryLabelPosition(org.pentaho.plugin.jfreereport.reportcharts.CategoricalChartExpression.PlaneDirection axisPosition, double labelAngle) Used instead oforg.jfree.chart.axis.CategoryLabelPosition.createUpRotationLabelPositions.It additionally takes into consideration the axis position.
- Parameters:
axisPosition-labelAngle-- Returns:
-
getTextAnchorDirectionOfAngle
protected org.pentaho.plugin.jfreereport.reportcharts.CategoricalChartExpression.PlaneDirection getTextAnchorDirectionOfAngle(double angle) Chooses a proper anchor for a text label at a chart axis tick.E.g.
Axis position is LEFT, label rotation = 0. So angle = 0.
Axis position is BOTTOM, label rotation = 90. So angle = 0.
Axis position is BOTTOM, label rotation = 0. So angle = pi/2 (90 degrees).
- Parameters:
angle- can be assumed as the label-relative direction to the axis.- Returns:
-