Package org.apache.poi.hssf.usermodel
Class HSSFChart
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFChart
-
public final class HSSFChart extends Object
Has methods for construction of a chart object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HSSFChart.HSSFChartType
static class
HSSFChart.HSSFSeries
A series in a chart
-
Constructor Summary
Constructors Constructor Description HSSFChart(HSSFSheet sheet, ChartRecord chart, LegendRecord legend, ChartTitleFormatRecord chartTitleFormat, SeriesTextRecord chartTitleText, List<Object[]> seriesList, List<ValueRangeRecord> valueRanges, Record chartType, Chart3DRecord chart3d, TextRecord titleTextRecord)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createBarChart(HSSFWorkbook workbook, HSSFSheet parentSheet)
Creates a bar chart.HSSFChart.HSSFSeries
createSeries()
Chart3DRecord
getChart3D()
int
getChartHeight()
Get the height of the chart.String
getChartTitle()
Returns the chart's title, if there is one, or null if notint
getChartWidth()
Get the width of the chart.int
getChartX()
Get the X offset of the chartint
getChartY()
Get the Y offset of the chartint
getLegendPos()
HSSFChart.HSSFSeries[]
getSeries()
Returns the series of the chartRecord
getShapeRecord()
static HSSFChart[]
getSheetCharts(HSSFSheet sheet)
Returns all the charts for the given sheet.HSSFChart.HSSFChartType
getType()
boolean
hasLegend()
boolean
isAutoTitleDeleted()
boolean
removeSeries(HSSFChart.HSSFSeries remSeries)
void
setChartHeight(int height)
Sets the height of the chart.void
setChartTitle(String title)
Changes the chart's title, but only if there was one already.void
setChartWidth(int width)
Sets the width of the chart.void
setChartX(int x)
Sets the X offset of the chartvoid
setChartY(int y)
Sets the Y offset of the chartvoid
setValueRange(int axisIndex, Double minimum, Double maximum, Double majorUnit, Double minorUnit)
Set value range (basic Axis Options)
-
-
-
Constructor Detail
-
HSSFChart
public HSSFChart(HSSFSheet sheet, ChartRecord chart, LegendRecord legend, ChartTitleFormatRecord chartTitleFormat, SeriesTextRecord chartTitleText, List<Object[]> seriesList, List<ValueRangeRecord> valueRanges, Record chartType, Chart3DRecord chart3d, TextRecord titleTextRecord)
-
-
Method Detail
-
createBarChart
public void createBarChart(HSSFWorkbook workbook, HSSFSheet parentSheet)
Creates a bar chart. API needs some work. :)NOTE: Does not yet work... checking it in just so others can take a look.
-
getSheetCharts
public static HSSFChart[] getSheetCharts(HSSFSheet sheet)
Returns all the charts for the given sheet. NOTE: You won't be able to do very much with these charts yet, as this is very limited support
-
getChartX
public int getChartX()
Get the X offset of the chart
-
getChartY
public int getChartY()
Get the Y offset of the chart
-
getChartWidth
public int getChartWidth()
Get the width of the chart.ChartRecord
-
getChartHeight
public int getChartHeight()
Get the height of the chart.ChartRecord
-
setChartX
public void setChartX(int x)
Sets the X offset of the chart
-
setChartY
public void setChartY(int y)
Sets the Y offset of the chart
-
setChartWidth
public void setChartWidth(int width)
Sets the width of the chart.ChartRecord
-
setChartHeight
public void setChartHeight(int height)
Sets the height of the chart.ChartRecord
-
getSeries
public HSSFChart.HSSFSeries[] getSeries()
Returns the series of the chart
-
getChartTitle
public String getChartTitle()
Returns the chart's title, if there is one, or null if not
-
setChartTitle
public void setChartTitle(String title)
Changes the chart's title, but only if there was one already. TODO - add in the records if not
-
setValueRange
public void setValueRange(int axisIndex, Double minimum, Double maximum, Double majorUnit, Double minorUnit)
Set value range (basic Axis Options)- Parameters:
axisIndex
- 0 - primary axis, 1 - secondary axisminimum
- minimum value; Double.NaN - automatic; null - no changemaximum
- maximum value; Double.NaN - automatic; null - no changemajorUnit
- major unit value; Double.NaN - automatic; null - no changeminorUnit
- minor unit value; Double.NaN - automatic; null - no change
-
createSeries
public HSSFChart.HSSFSeries createSeries() throws Exception
- Throws:
Exception
-
removeSeries
public boolean removeSeries(HSSFChart.HSSFSeries remSeries)
-
getType
public HSSFChart.HSSFChartType getType()
-
getChart3D
public Chart3DRecord getChart3D()
-
getShapeRecord
public Record getShapeRecord()
-
hasLegend
public boolean hasLegend()
-
getLegendPos
public int getLegendPos()
-
isAutoTitleDeleted
public boolean isAutoTitleDeleted()
-
-