public class Chart extends Object
Sheet.
Charts in SODS store metadata such as title, footer, legend configuration,
and range addresses used to pull data from the sheet. This object does not
perform rendering; it captures the information required to serialize the
chart into the ODS output.| Constructor and Description |
|---|
Chart() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCategory(Object category)
Adds a category value to this chart.
|
void |
addData(String data)
Adds a data range address to this chart.
|
void |
addSeries(ChartSeries series)
Adds a series to this chart.
|
List<Object> |
getCategories()
Returns the category values used by the chart.
|
String |
getCategoriesRangeAddress()
Returns the A1 range address for the categories.
|
Range |
getCategoriesRangeObject()
Resolves the categories range address into a
Range. |
List<String> |
getData()
Returns the data ranges used by the chart.
|
String |
getFooter()
Returns the chart footer text.
|
String |
getHeight()
Returns the chart height.
|
String |
getLegend()
Returns the legend configuration string.
|
ChartStyle |
getPlotAreaStyle()
Returns the plot area style.
|
List<ChartSeries> |
getSeries()
Returns the series list associated with this chart.
|
Sheet |
getSheet()
Returns the sheet that owns this chart.
|
ChartStyle |
getStyle()
Returns the chart style.
|
String |
getTitle()
Returns the chart title.
|
String |
getType()
Returns the chart type identifier.
|
ChartStyle |
getWallStyle()
Returns the wall style.
|
String |
getWidth()
Returns the chart width.
|
String |
getX()
Returns the X position.
|
ChartAxis |
getXAxis()
Returns the X axis configuration.
|
String |
getXAxisLabel()
Returns the label for the X axis.
|
String |
getY()
Returns the Y position.
|
ChartAxis |
getYAxis()
Returns the Y axis configuration.
|
String |
getYAxisLabel()
Returns the label for the Y axis.
|
boolean |
isDisplayLabel()
Returns whether labels are displayed.
|
boolean |
isShowWall()
Returns whether the wall is displayed.
|
void |
setCategoriesRangeAddress(String categoriesRangeAddress)
Sets the A1 range address for categories.
|
void |
setDisplayLabel(boolean displayLabel)
Enables or disables label display.
|
void |
setFooter(String footer)
Sets the chart footer text.
|
void |
setHeight(String height)
Sets the chart height.
|
void |
setLegend(String legend)
Sets the legend configuration value.
|
void |
setPlotAreaStyle(ChartStyle plotAreaStyle)
Sets the plot area style.
|
void |
setShowWall(boolean showWall)
Enables or disables wall display.
|
void |
setStyle(ChartStyle style)
Sets the chart style.
|
void |
setTitle(String title)
Sets the chart title.
|
void |
setType(String type)
Sets the chart type identifier.
|
void |
setWallStyle(ChartStyle wallStyle)
Sets the wall style.
|
void |
setWidth(String width)
Sets the chart width.
|
void |
setX(String x)
Sets the X position.
|
void |
setXAxisLabel(String xAxisLabel)
Sets the label for the X axis.
|
void |
setY(String y)
Sets the Y position.
|
void |
setYAxisLabel(String yAxisLabel)
Sets the label for the Y axis.
|
public String getType()
public String getTitle()
public String getFooter()
public String getLegend()
public List<String> getData()
public List<Object> getCategories()
public String getCategoriesRangeAddress()
public Range getCategoriesRangeObject()
Range.
This is a convenience method that looks up the range against the
owning sheet, if present.public List<ChartSeries> getSeries()
public Sheet getSheet()
public String getWidth()
public String getHeight()
public String getX()
public String getY()
public String getXAxisLabel()
public String getYAxisLabel()
public boolean isDisplayLabel()
public ChartStyle getStyle()
setStyle(ChartStyle) to apply changes.public ChartStyle getPlotAreaStyle()
setPlotAreaStyle(ChartStyle) to apply changes.public ChartStyle getWallStyle()
setWallStyle(ChartStyle) to apply changes.public ChartAxis getXAxis()
public ChartAxis getYAxis()
public boolean isShowWall()
public void setType(String type)
type - The chart type.public void setTitle(String title)
title - The title text.public void setFooter(String footer)
footer - The footer text.public void setLegend(String legend)
legend - The legend value.public void addData(String data)
data - The range address.public void addCategory(Object category)
category - The category value.public void setCategoriesRangeAddress(String categoriesRangeAddress)
categoriesRangeAddress - The range address.public void addSeries(ChartSeries series)
series - The series to add. If null, it is ignored.public void setWidth(String width)
width - The width value.public void setHeight(String height)
height - The height value.public void setX(String x)
x - The X position value.public void setY(String y)
y - The Y position value.public void setXAxisLabel(String xAxisLabel)
xAxisLabel - The label text.public void setYAxisLabel(String yAxisLabel)
yAxisLabel - The label text.public void setDisplayLabel(boolean displayLabel)
displayLabel - True to display labels.public void setStyle(ChartStyle style)
style - The chart style.public void setPlotAreaStyle(ChartStyle plotAreaStyle)
plotAreaStyle - The plot area style.public void setWallStyle(ChartStyle wallStyle)
wallStyle - The wall style.public void setShowWall(boolean showWall)
showWall - True to display the wall.Copyright © 2026. All rights reserved.