i-net Clear Reports

com.inet.report
Class Chart2

java.lang.Object
  extended by com.inet.report.ReportComponent
      extended by com.inet.report.Element
          extended by com.inet.report.Chart2
All Implemented Interfaces:
BorderProperties, GeneralProperties, HyperlinkProperties, NodeParser, com.inet.report.ReferenceHolder, java.io.Serializable, java.lang.Cloneable

public class Chart2
extends Element
implements HyperlinkProperties, BorderProperties

This class represents a chart element with new chart API that has been or should be drawn in a report. A chart (or graph) visualize your data with some graphics.

To create a new chart use Section.addChart2(ChartStyle, int, int, int, int).
To change the chart style use setPlot(ChartPlot).

A chart instance contains properties of the chart titles (header, subtitle, footnote), legend and plot properties.
If you want to edit the style specific properties you can get the plot with getPlot() and cast it to the plot which belong to this chart style. For more information see the class ChartStyle.

If you create a new chart all properties except dataset are initialized with default. To set the dataset properties use ChartPlot.getDataset(). For more information see the class BaseDataset.

For the information how to use the old chart API please see ChartConverter.

Since:
8.0
See Also:
ChartConverter.replaceChart(OldChart), getHeaderTitle(), getSubtitle(), getFootnote(), getLegend(), getPlot(), Serialized Form

Field Summary
static ChartStyle DEFAULT_CHART_STYLE
          Default chart style.
static java.lang.String DEFAULT_FONT_NAME
          the default font used by chart.
static ChartTitle DEFAULT_FOOTNOTE_TITLE
          the default font and color properties of footnote title of chart.
static ChartTitle DEFAULT_HEADER_TITLE
          The default font and color properties of header title of chart.
static ChartTitle DEFAULT_SUBTITLE_TITLE
          the default font and color properties of subtitle title of chart.
static java.lang.String PLOT_ORIENTATION_HORIZONTAL
          A constant for the horizontal orientation of chart.
static java.lang.String PLOT_ORIENTATION_VERTICAL
          A constant for the vertical orientation of chart.
 
Fields inherited from class com.inet.report.Element
BOX, CHART, CROSSTAB, CROSSTABCELL, CROSSTABCOLUMN, CROSSTABROW, CROSSTABSECTION, DATABASE_PICTURE, FIELD, FIELDPART, FORMFIELD, INTERACTIVE_SORTING, JAVABEAN, LINE, PARAGRAPH, PICTURE, SIGNATURE, SUBREPORT, TEXT, TEXTPART
 
Fields inherited from interface com.inet.report.BorderProperties
LINE_STYLE_DASHED, LINE_STYLE_DOTTED, LINE_STYLE_DOUBLE, LINE_STYLE_SINGLE, NO_LINE
 
Fields inherited from interface com.inet.report.GeneralProperties
ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_DEFAULT, ALIGN_HORIZONTAL_JUSTIFIED, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_RIGHT
 
Method Summary
 ChartTitle getFootnote()
          Returns the footnote of this chart.
 ChartTitle getHeaderTitle()
          Returns the header title of this chart.
 Legend getLegend()
          Returns the legend of this chart.
 java.util.Locale getLocale()
          Returns chart locale.
 java.util.ResourceBundle getLocalizationResources()
          Returns a localized resources bundle for the chart messages.
 ChartPlot getPlot()
          Returns the plot of chart.
 java.lang.String getPlotOrientation()
          Returns the plot orientation of this chart.
 ChartTitle getSubtitle()
          Returns the sub title of this chart.
 void refreshAutoTitles()
          Reads out the data column names from dataset and refreshes the chart labels.
 void setFootnote(ChartTitle footnote)
          Sets the footnote of this chart.
 void setHeaderTitle(ChartTitle headerTitle)
          Sets the header title of this chart.
 void setLegend(Legend legend)
          Sets the legend of this chart.
 void setPlot(ChartPlot plot)
          Sets a new plot for this chart.
 void setPlotOrientation(java.lang.String plotOrientation)
          Sets the plot orientation of this chart.
 void setSubtitle(ChartTitle subtitle)
          Sets the sub title of this chart.
 
Methods inherited from class com.inet.report.Element
addListener, copy, getBottomLineStyle, getBottomLineStyleFormula, getCanGrowCount, getCanGrowFormula, getCloseBorderOnPageBreakFormula, getDropShadowFormula, getEngine, getField, getForeColor, getForeColorFormula, getHorAlign, getHorAlignFormula, getHyperlinkUrl, getHyperlinkUrlFormula, getLeftLineStyle, getLeftLineStyleFormula, getParent, getPropertyFormulas, getRightLineStyle, getRightLineStyleFormula, getSuppressIfDuplicatedFormula, getTightHorizontalFormula, getToolTipsText, getToolTipsTextFormula, getTopLineStyle, getTopLineStyleFormula, indexOf, isCanGrow, isCloseBorderOnPageBreak, isDropShadow, isSuppressIfDuplicated, isTightHorizontal, paramString, removeListener, setBottomLineStyle, setBottomLineStyleFormula, setCanGrow, setCanGrowCount, setCanGrowFormula, setCloseBorderOnPageBreak, setCloseBorderOnPageBreakFormula, setDropShadow, setDropShadowFormula, setField, setForeColor, setForeColorFormula, setHorAlign, setHorAlignFormula, setHyperlinkUrl, setHyperlinkUrlFormula, setIndex, setLeftLineStyle, setLeftLineStyleFormula, setRightLineStyle, setRightLineStyleFormula, setSuppressIfDuplicated, setSuppressIfDuplicatedFormula, setTightHorizontal, setTightHorizontalFormula, setToolTipsText, setToolTipsTextFormula, setTopLineStyle, setTopLineStyleFormula
 
Methods inherited from class com.inet.report.ReportComponent
getBackColor, getBackColorFormula, getHeight, getKeepTogetherFormula, getSuppressFormula, getType, getWidth, getX, getY, isKeepTogether, isSuppress, setBackColor, setBackColorFormula, setHeight, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula, setWidth, setX, setY
 
Methods inherited from interface com.inet.report.HyperlinkProperties
getHyperlinkUrl, getHyperlinkUrlFormula, setHyperlinkUrl, setHyperlinkUrlFormula
 
Methods inherited from interface com.inet.report.BorderProperties
getBackColor, getBackColorFormula, getBottomLineStyle, getBottomLineStyleFormula, getCloseBorderOnPageBreakFormula, getDropShadowFormula, getForeColor, getForeColorFormula, getLeftLineStyle, getLeftLineStyleFormula, getRightLineStyle, getRightLineStyleFormula, getTightHorizontalFormula, getTopLineStyle, getTopLineStyleFormula, isCloseBorderOnPageBreak, isDropShadow, isTightHorizontal, setBackColor, setBackColorFormula, setBottomLineStyle, setBottomLineStyleFormula, setCloseBorderOnPageBreak, setCloseBorderOnPageBreakFormula, setDropShadow, setDropShadowFormula, setForeColor, setForeColorFormula, setLeftLineStyle, setLeftLineStyleFormula, setRightLineStyle, setRightLineStyleFormula, setTightHorizontal, setTightHorizontalFormula, setTopLineStyle, setTopLineStyleFormula
 
Methods inherited from interface com.inet.report.GeneralProperties
getKeepTogetherFormula, getSuppressFormula, isKeepTogether, isSuppress, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula
 
Methods inherited from interface com.inet.report.parser.NodeParser
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
 

Field Detail

DEFAULT_CHART_STYLE

public static final ChartStyle DEFAULT_CHART_STYLE
Default chart style. This style will be used by creating a chart without custom chart style.


DEFAULT_FONT_NAME

public static final java.lang.String DEFAULT_FONT_NAME
the default font used by chart.

See Also:
Constant Field Values

DEFAULT_HEADER_TITLE

public static final ChartTitle DEFAULT_HEADER_TITLE
The default font and color properties of header title of chart.


DEFAULT_SUBTITLE_TITLE

public static final ChartTitle DEFAULT_SUBTITLE_TITLE
the default font and color properties of subtitle title of chart.


DEFAULT_FOOTNOTE_TITLE

public static final ChartTitle DEFAULT_FOOTNOTE_TITLE
the default font and color properties of footnote title of chart.


PLOT_ORIENTATION_VERTICAL

public static final java.lang.String PLOT_ORIENTATION_VERTICAL
A constant for the vertical orientation of chart.

See Also:
Constant Field Values

PLOT_ORIENTATION_HORIZONTAL

public static final java.lang.String PLOT_ORIENTATION_HORIZONTAL
A constant for the horizontal orientation of chart.

See Also:
Constant Field Values
Method Detail

getPlotOrientation

public java.lang.String getPlotOrientation()
Returns the plot orientation of this chart.

Returns:
the orientation name.
Since:
8.0
See Also:
setPlotOrientation(String), PLOT_ORIENTATION_HORIZONTAL, PLOT_ORIENTATION_VERTICAL

setPlotOrientation

public void setPlotOrientation(java.lang.String plotOrientation)
Sets the plot orientation of this chart.

Parameters:
plotOrientation - the plot orientation name (null not permitted).
Throws:
java.lang.IllegalArgumentException - by null or unknown plot orientation.
Since:
8.0
See Also:
getPlotOrientation(), PLOT_ORIENTATION_HORIZONTAL, PLOT_ORIENTATION_VERTICAL

getHeaderTitle

public ChartTitle getHeaderTitle()
Returns the header title of this chart.

Returns:
the chart title.
Since:
8.0
See Also:
setHeaderTitle(ChartTitle), ChartTitle

setHeaderTitle

public void setHeaderTitle(ChartTitle headerTitle)
Sets the header title of this chart.

Parameters:
headerTitle - the title (null not permitted).
Since:
8.0
See Also:
getHeaderTitle(), ChartTitle

getSubtitle

public ChartTitle getSubtitle()
Returns the sub title of this chart. The sub title is the title below the header.

Returns:
the chart title.
Since:
8.0
See Also:
setSubtitle(com.inet.report.chart.ChartTitle), ChartTitle

setSubtitle

public void setSubtitle(ChartTitle subtitle)
Sets the sub title of this chart. The sub title is the title below the header.

Parameters:
subtitle - the title (null not permitted).
Since:
8.0
See Also:
getSubtitle(), ChartTitle

getFootnote

public ChartTitle getFootnote()
Returns the footnote of this chart. The footnote is the title of the bottom bound of chart.

Returns:
the chart title.
Since:
8.0
See Also:
setFootnote(com.inet.report.chart.ChartTitle), ChartTitle

setFootnote

public void setFootnote(ChartTitle footnote)
Sets the footnote of this chart. The footnote is the title of the bottom bound of chart.

Parameters:
footnote - the title (null not permitted).
Since:
8.0
See Also:
getFootnote(), ChartTitle

getPlot

public ChartPlot getPlot()
Returns the plot of chart. This can be a simple plot extended from AbstractPlot or a CombinedPlot with a list of simple plots. A plot of type AbstractPlot you can cast to a plot appropriate to chart style. See the implementations of interface ChartStyle.

Returns:
the plot.
Since:
8.0
See Also:
setPlot(com.inet.report.chart.plot.ChartPlot), AbstractPlot, BarPlot, LinePlot, AreaPlot, Chart3DPlot, PolarPlot, GanttPlot, PiePlot, StockPlot, XYPlot, ContinuousBarPlot, ContinuousLinePlot, ContinuousAreaPlot

setPlot

public void setPlot(ChartPlot plot)
Sets a new plot for this chart. This can be a simple plot extended from AbstractPlot or a CombinedPlot with a list of simple plots.
To change the chart style use a.s. LineStyle.LINE_MARKER_STACKED to get a stacked line style, use LineStyle.getDefaultPlot() to get a new line plot and set it with this function.

Parameters:
plot - the plot (null not permitted).
Since:
8.0
See Also:
getPlot(), ChartStyle.getDefaultPlot(), ChartPlot, AbstractPlot, CombinedPlot

getLegend

public Legend getLegend()
Returns the legend of this chart.

Returns:
the legend.
Since:
8.0
See Also:
setLegend(Legend)

setLegend

public void setLegend(Legend legend)
Sets the legend of this chart. To disable legend showing use Legend.setLegendPlacement(com.inet.report.chart.LegendPlacement) with parameter LegendPlacement.NONE.

Parameters:
legend - the legend (null not permitted).
Since:
8.0
See Also:
getLegend()

refreshAutoTitles

public void refreshAutoTitles()
Reads out the data column names from dataset and refreshes the chart labels. Please use this function to refresh the chart labels if the data was be changed.

Since:
8.0

getLocalizationResources

public java.util.ResourceBundle getLocalizationResources()
Returns a localized resources bundle for the chart messages. The chart uses the client locale.

Returns:
the bundle.
Since:
8.0
See Also:
Engine.setLocale(java.util.Locale), Engine.setClientLocale(java.util.Locale)

getLocale

public java.util.Locale getLocale()
Returns chart locale. This function defines which locale is used by formatting of the chart labels. To set this locale please use Engine.setClientLocale(Locale). Is the client locale not set, chart use the server locale.

Returns:
the locale.
Since:
8.0
See Also:
Engine.setClientLocale(Locale)

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH