public class Chart extends InteractiveObject
| Constructor and Description |
|---|
Chart(Worksheet worksheet)
Initializes a new instance of the
Chart class. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes this object of any unmanaged resources it might hold.
|
void |
draw(IRenderTarget target,
RenderContext context,
java.awt.Rectangle rect) |
Measure |
getActualHeight() |
Measure |
getActualWidth() |
java.awt.Color |
getAxisColor()
Gets the color of the chart axes.
|
Measure |
getAxisSize()
Gets the thickness of the chart axes, or null, to use a hairline thickness.
|
DashStyle |
getAxisStyle()
Gets the style of the chart axes, or null, to draw solid lines.
|
java.awt.Color[] |
getDefaultColors()
Gets the default colors for data series that do not have explicitly defined colors.
|
Measure |
getDefaultLineSize()
Gets the default thickness in line and radar charts for series that have no explicitly specified line size.
|
java.lang.String |
getDefaultSeriesNameFormat()
Gets the format of the names of the data series that do not have an explicitly defined name.
|
Brush |
getFill()
Gets a brush used to fill the background of the chart.
|
boolean |
getFontBold()
Gets a value indicating whether the text in the chart is bold.
|
boolean |
getFontItalic()
Gets a value indicating whether the text in the chart is italic.
|
java.lang.String |
getFontName()
Gets the font of the texts in the chart.
|
double |
getFontSize()
Gets the font size of the texts of the chart.
|
boolean |
getFontStrikeout()
Gets a value indicating whether the text in the chart is with a line through the middle.
|
boolean |
getFontUnderline()
Gets a value indicating whether the text in the chart is underlined.
|
java.awt.Color |
getGridLineColor()
Gets the color of the major grid lines.
|
Measure |
getGridLineSize()
Gets the thickness of the major grid lines, or null, to use a hairline thickness.
|
DashStyle |
getGridLineStyle()
Gets the style of the major grid lines, or null, to draw solid lines.
|
java.awt.Image |
getImage() |
java.awt.Color |
getLegendBorderColor()
Gets the border color of the legend, or null, to hide the border.
|
Measure |
getLegendBorderSize()
Gets the border thickness of the legend, or null, to use a hairline thickness.
|
DashStyle |
getLegendBorderStyle()
Gets the border style of the legend, or null, to use a solid line.
|
Brush |
getLegendFill()
Gets a brush used to fill the legend's background.
|
java.lang.Boolean |
getLegendFontBold()
Gets a value indicating whether the legend text is bold, or null, to use the FontBold property.
|
java.lang.Boolean |
getLegendFontItalic()
Gets a value indicating whether the legend text is italic,
or null, to use the
FontItalic property. |
java.lang.String |
getLegendFontName()
Gets the font name of the legend, or null, to use the
FontName property. |
java.lang.Double |
getLegendFontSize()
Gets the font size of the legend, or null, to use the FontSize property.
|
java.lang.Boolean |
getLegendFontStrikeout()
Gets a value indicating whether the legend text is with a line through the middle,
or null, to use the
FontStrikeout property. |
java.lang.Boolean |
getLegendFontUnderline()
Gets a value indicating whether the legend text is underlined,
or null, to use the
FontUnderline property. |
java.lang.Integer |
getLegendLanes()
Gets the number of columns or rows to use when layouting items inside the legend,
or null, to use the default number of columns or rows, which is 1.
|
LegendPosition |
getLegendPosition()
Gets the legend position.
|
java.awt.Color |
getLegendTextColor()
Gets the color of the texts in the legend, or null, to use the TextColor property.
|
MarkShape |
getMarkShape()
Gets the shape of marks in the chart, or null, to use alternating shapes.
|
java.awt.Color |
getPlotBorderColor()
Gets the border color of the chart's plot area, or null, to hide the border.
|
Measure |
getPlotBorderSize()
Gets the border thickness of the chart's plot area, or null, to use a hairline thickness.
|
DashStyle |
getPlotBorderStyle()
Gets the border style of the chart's plot area, or null, to use a solid line.
|
Brush |
getPlotFill()
Gets a brush used to fill the background of the chart's plot area.
|
SeriesCollection |
getSeries()
Gets a collection with the data series of the chart.
|
boolean |
getShowLegend()
Gets a value indicating whether to display the chart's legend.
|
java.awt.Color |
getTextColor()
Gets the color of the texts in the chart.
|
java.lang.Boolean |
getTitleFontBold()
Gets a value indicating whether the chart title is bold, or null,
to use the
FontBold property. |
java.lang.Boolean |
getTitleFontItalic()
Gets a value indicating whether the chart title is italic, or null,
to use the
FontItalic property. |
java.lang.String |
getTitleFontName()
Gets the font of the chart title, or null, to use the
FontName property. |
java.lang.Double |
getTitleFontSize()
Gets the font size of the chart title, or null, to use the
FontSize property. |
java.lang.Boolean |
getTitleFontStrikeout()
Gets a value indicating whether the chart title is with a line through the middle,
or null, to use the
FontStrikeout property. |
java.lang.Boolean |
getTitleFontUnderline()
Gets a value indicating whether the chart title is underlined, or null,
to use the
FontUnderline property. |
java.awt.Color |
getTitleTextColor()
Gets the color of the chart title, or null, to use the
TextColor property. |
ChartType |
getType()
Gets the type of the chart.
|
AxisSettings |
getXAxisSettings()
Gets the settings for the category label axis of the chart, if the chart is an axes chart.
|
AxisSettings |
getYAxisSettings()
Gets the settings for the value axis of the chart, if the chart is an axes chart.
|
void |
onAttach()
This method is called when the object is added to a worksheet.
|
void |
onDetach()
This method is called when the object is removed from a worksheet.
|
void |
onPropertyChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
This method is called when the value of a property of this object is changed.
|
protected void |
onResized()
This method is called when the object's size is changed.
|
void |
onWorksheetPropertyChanged(java.beans.PropertyChangeEvent e)
Called when a property of the worksheet this chart belongs to is changed.
|
java.lang.Object |
refactorReferences(java.util.function.Function<CellRef,CellRef> func)
Transforms all cell references in this object using the specified function.
|
void |
restoreReferences(java.lang.Object state)
Restores the cell references in this object to the values before RefactorReferences call.
|
void |
setAxisColor(java.awt.Color value) |
void |
setAxisSize(Measure value)
Sets the thickness of the chart axes, or null, to use a hairline thickness.
|
void |
setAxisStyle(DashStyle value)
Sets the style of the chart axes, or null, to draw solid lines.
|
boolean |
setDataSource(java.lang.String data,
PlotBy plotBy,
java.lang.Boolean firstColumnAsLabel,
java.lang.Boolean firstRowAsLabel)
Sets the chart data source to the specified range of cells.
|
boolean |
setDataSource(java.lang.String data,
PlotBy plotBy,
java.lang.Boolean firstColumnAsLabel,
java.lang.Boolean firstRowAsLabel,
boolean isCultureInvariant) |
void |
setDefaultColors(java.awt.Color[] value)
Sets the default colors for data series that do not have explicitly defined colors.
|
void |
setDefaultLineSize(Measure value)
Sets the default thickness in line and radar charts for series that have no explicitly specified line size.
|
void |
setDefaultSeriesNameFormat(java.lang.String value)
Sets the format of the names of the data series that do not have an explicitly defined name.
|
void |
setFill(Brush value)
Sets a brush used to fill the background of the chart.
|
void |
setFontBold(boolean value)
Sets a value indicating whether the text in the chart is bold.
|
void |
setFontItalic(boolean value)
Sets a value indicating whether the text in the chart is italic.
|
void |
setFontName(java.lang.String value)
Sets the font of the texts in the chart.
|
void |
setFontSize(double value)
Sets the font size of the texts of the chart.
|
void |
setFontStrikeout(boolean value)
Sets a value indicating whether the text in the chart is with a line through the middle.
|
void |
setFontUnderline(boolean value)
Sets a value indicating whether the text in the chart is underlined.
|
void |
setGridLineColor(java.awt.Color value)
Sets the color of the major grid lines.
|
void |
setGridLineSize(Measure value)
Sets the thickness of the major grid lines, or null, to use a hairline thickness.
|
void |
setGridLineStyle(DashStyle value)
Sets the style of the major grid lines, or null, to draw solid lines.
|
void |
setLegendBorderColor(java.awt.Color value)
Sets the border color of the legend, or null, to hide the border.
|
void |
setLegendBorderSize(Measure value)
Sets the border thickness of the legend, or null, to use a hairline thickness.
|
void |
setLegendBorderStyle(DashStyle value) |
void |
setLegendFill(Brush value)
Sets a brush used to fill the legend's background.
|
void |
setLegendFontBold(java.lang.Boolean value)
Sets a value indicating whether the legend text is bold, or null, to use the FontBold property.
|
void |
setLegendFontItalic(java.lang.Boolean value)
Sets a value indicating whether the legend text is italic,
or null, to use the
FontItalic property. |
void |
setLegendFontName(java.lang.String value)
Sets the font name of the legend, or null, to use the
FontName property. |
void |
setLegendFontSize(java.lang.Double value)
Sets the font size of the legend, or null, to use the FontSize property.
|
void |
setLegendFontStrikeout(java.lang.Boolean value)
Sets a value indicating whether the legend text is with a line through the middle,
or null, to use the
FontStrikeout property. |
void |
setLegendFontUnderline(java.lang.Boolean value)
Sets a value indicating whether the legend text is underlined,
or null, to use the
FontUnderline property. |
void |
setLegendLanes(java.lang.Integer value)
Sets the number of columns or rows to use when layouting items inside the legend,
or null, to use the default number of columns or rows, which is 1.
|
void |
setLegendPosition(LegendPosition value)
Sets the legend position.
|
void |
setLegendTextColor(java.awt.Color value)
Sets the color of the texts in the legend, or null, to use the TextColor property.
|
void |
setMarkShape(MarkShape value)
Gets the shape of marks in the chart, or null, to use alternating shapes.
|
void |
setPlotBorderColor(java.awt.Color value)
Sets the border color of the chart's plot area, or null, to hide the border.
|
void |
setPlotBorderSize(Measure value)
Sets the border thickness of the chart's plot area, or null, to use a hairline thickness.
|
void |
setPlotBorderStyle(DashStyle value)
Sets the border style of the chart's plot area, or null, to use a solid line.
|
void |
setPlotFill(Brush value)
Sets a brush used to fill the background of the chart's plot area.
|
void |
setShowLegend(boolean value)
Sets a value indicating whether to display the chart's legend.
|
void |
setTextColor(java.awt.Color value)
Sets the color of the texts in the chart.
|
void |
setTitleFontBold(java.lang.Boolean value)
Sets a value indicating whether the chart title is bold, or null,
to use the
FontBold property. |
void |
setTitleFontItalic(java.lang.Boolean value)
Sets a value indicating whether the chart title is italic, or null,
to use the
FontItalic property. |
void |
setTitleFontName(java.lang.String value)
Sets the font of the chart title, or null, to use the
FontName property. |
void |
setTitleFontSize(java.lang.Double value)
Sets the font size of the chart title, or null, to use the
FontSize property. |
void |
setTitleFontStrikeout(java.lang.Boolean value)
Sets a value indicating whether the chart title is with a line through the middle,
or null, to use the
FontStrikeout property. |
void |
setTitleFontUnderline(java.lang.Boolean value)
Sets a value indicating whether the chart title is underlined, or null,
to use the
FontUnderline property. |
void |
setTitleTextColor(java.awt.Color value)
Sets the color of the chart title, or null, to use the
TextColor property. |
void |
setType(ChartType value)
Sets the type of the chart.
|
bringForward, bringToFront, getAnchor, getAnchorPosition, getDescription, getExtendsOutsideBounds, getFromColumn, getFromRow, getHeight, getHorizontalOffset, getLineColor, getLineSize, getLineStyle, getLocked, getRegardsMergedCells, getTitle, getVerticalOffset, getWidth, getWorksheet, invalidate, isLockedToCell, onPropertyChanged, sendBackward, sendToBack, setAnchor, setAnchorPosition, setDescription, setFromColumn, setFromRow, setHeight, setHorizontalOffset, setLineColor, setLineSize, setLineStyle, setLocked, setTitle, setVerticalOffset, setWidthpublic void dispose()
dispose in class InteractiveObjectprotected void onResized()
onResized in class InteractiveObjectpublic void onPropertyChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
onPropertyChanged in class InteractiveObjectpublic void onWorksheetPropertyChanged(java.beans.PropertyChangeEvent e)
onWorksheetPropertyChanged in class InteractiveObjectpublic void onAttach()
onAttach in class InteractiveObjectpublic void onDetach()
onDetach in class InteractiveObjectpublic void draw(IRenderTarget target, RenderContext context, java.awt.Rectangle rect)
draw in class InteractiveObjectpublic java.lang.Object refactorReferences(java.util.function.Function<CellRef,CellRef> func)
refactorReferences in class InteractiveObjectpublic void restoreReferences(java.lang.Object state)
restoreReferences in class InteractiveObjectpublic Measure getActualWidth()
getActualWidth in class InteractiveObjectpublic Measure getActualHeight()
getActualHeight in class InteractiveObjectpublic boolean setDataSource(java.lang.String data,
PlotBy plotBy,
java.lang.Boolean firstColumnAsLabel,
java.lang.Boolean firstRowAsLabel)
The changes caused by this method are automatically recorded for subsequent undo,
therefore it is not necessary to call this method in the scope of a TrackChangesCommand.
data - A string specifying a range of cells or an expression which evaluates to a range of cells.plotBy - A flag specifying whether the series are created
from the columns or from the rows in the specified range.firstColumnAsLabel - A flag specifying whether to use the values in the first column
of the specified range as labels, or null, to attempt to automatically determine this based
on the type of the data. This parameter is ignored by some charts that do not display labels.firstRowAsLabel - A flag specifying whether to use the values in the first row of
the specified range as labels, or null, to attempt to automatically determine this based
on the type of the data. This parameter is ignored by some charts that do not display labels.public boolean setDataSource(java.lang.String data,
PlotBy plotBy,
java.lang.Boolean firstColumnAsLabel,
java.lang.Boolean firstRowAsLabel,
boolean isCultureInvariant)
public java.awt.Image getImage()
public ChartType getType()
public void setType(ChartType value)
public SeriesCollection getSeries()
public java.lang.String getDefaultSeriesNameFormat()
public void setDefaultSeriesNameFormat(java.lang.String value)
public java.awt.Color[] getDefaultColors()
public void setDefaultColors(java.awt.Color[] value)
public AxisSettings getXAxisSettings()
public AxisSettings getYAxisSettings()
public java.lang.String getFontName()
public void setFontName(java.lang.String value)
public double getFontSize()
public void setFontSize(double value)
public boolean getFontBold()
public void setFontBold(boolean value)
public boolean getFontItalic()
public void setFontItalic(boolean value)
public boolean getFontUnderline()
public void setFontUnderline(boolean value)
public boolean getFontStrikeout()
public void setFontStrikeout(boolean value)
public Brush getFill()
public void setFill(Brush value)
public java.awt.Color getTextColor()
public void setTextColor(java.awt.Color value)
public java.lang.String getTitleFontName()
FontName property.public void setTitleFontName(java.lang.String value)
FontName property.public java.lang.Double getTitleFontSize()
FontSize property.public void setTitleFontSize(java.lang.Double value)
FontSize property.public java.lang.Boolean getTitleFontBold()
FontBold property.public void setTitleFontBold(java.lang.Boolean value)
FontBold property.public java.lang.Boolean getTitleFontItalic()
FontItalic property.public void setTitleFontItalic(java.lang.Boolean value)
FontItalic property.public java.lang.Boolean getTitleFontUnderline()
FontUnderline property.public void setTitleFontUnderline(java.lang.Boolean value)
FontUnderline property.public java.lang.Boolean getTitleFontStrikeout()
FontStrikeout property.public void setTitleFontStrikeout(java.lang.Boolean value)
FontStrikeout property.public java.awt.Color getTitleTextColor()
TextColor property.public void setTitleTextColor(java.awt.Color value)
TextColor property.public Brush getPlotFill()
public void setPlotFill(Brush value)
public java.awt.Color getPlotBorderColor()
public void setPlotBorderColor(java.awt.Color value)
public Measure getPlotBorderSize()
public void setPlotBorderSize(Measure value)
public DashStyle getPlotBorderStyle()
public void setPlotBorderStyle(DashStyle value)
public boolean getShowLegend()
public void setShowLegend(boolean value)
public LegendPosition getLegendPosition()
public void setLegendPosition(LegendPosition value)
public java.lang.String getLegendFontName()
FontName property.public void setLegendFontName(java.lang.String value)
FontName property.public java.lang.Double getLegendFontSize()
public void setLegendFontSize(java.lang.Double value)
public java.lang.Boolean getLegendFontBold()
public void setLegendFontBold(java.lang.Boolean value)
public java.lang.Boolean getLegendFontItalic()
FontItalic property.public void setLegendFontItalic(java.lang.Boolean value)
FontItalic property.public java.lang.Boolean getLegendFontUnderline()
FontUnderline property.public void setLegendFontUnderline(java.lang.Boolean value)
FontUnderline property.public java.lang.Boolean getLegendFontStrikeout()
FontStrikeout property.public void setLegendFontStrikeout(java.lang.Boolean value)
FontStrikeout property.public java.awt.Color getLegendTextColor()
public void setLegendTextColor(java.awt.Color value)
public Brush getLegendFill()
public void setLegendFill(Brush value)
public java.awt.Color getLegendBorderColor()
public void setLegendBorderColor(java.awt.Color value)
public Measure getLegendBorderSize()
public void setLegendBorderSize(Measure value)
public DashStyle getLegendBorderStyle()
public void setLegendBorderStyle(DashStyle value)
public java.lang.Integer getLegendLanes()
This property applies to the number of columns in a left/right-aligned legends and on the number of rows in top/bottom-aligned legends.
public void setLegendLanes(java.lang.Integer value)
This property applies to the number of columns in a left/right-aligned legends and on the number of rows in top/bottom-aligned legends.
public java.awt.Color getGridLineColor()
public void setGridLineColor(java.awt.Color value)
public Measure getGridLineSize()
public void setGridLineSize(Measure value)
public DashStyle getGridLineStyle()
public void setGridLineStyle(DashStyle value)
public java.awt.Color getAxisColor()
public void setAxisColor(java.awt.Color value)
public Measure getAxisSize()
public void setAxisSize(Measure value)
public DashStyle getAxisStyle()
public void setAxisStyle(DashStyle value)
public Measure getDefaultLineSize()
public void setDefaultLineSize(Measure value)
public MarkShape getMarkShape()
public void setMarkShape(MarkShape value)