Top Description Inners Fields Constructors Methods
org.apache.poi.hssf.usermodel

public final Class HSSFChart

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .List, org.apache.poi.hssf.record.BOFRecord, .DimensionsRecord, .EOFRecord, .FooterRecord, .HCenterRecord, .HeaderRecord, .PrintSetupRecord, .ProtectRecord, .Record, .RecordBase, .SCLRecord, .UnknownRecord, .VCenterRecord, org.apache.poi.hssf.record.chart.*, org.apache.poi.ss.formula.ptg.Area3DPtg, .AreaPtgBase, .Ptg, org.apache.poi.ss.util.CellRangeAddress, .CellRangeAddressBase

Has methods for construction of a chart object.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static class
HSSFChart.HSSFSeries

A series in a chart

Field Summary

Modifier and TypeField and Description
private ChartRecord
private ChartTitleFormatRecord
private SeriesTextRecord
private LegendRecord
private List<HSSFChart.HSSFSeries>
private HSSFSheet
private HSSFChart.HSSFChartType
private List<ValueRangeRecord>

Constructor Summary

AccessConstructor and Description
private
HSSFChart(HSSFSheet sheet, ChartRecord chartRecord)

Method Summary

Modifier and TypeMethod and Description
private TextRecord
private AreaFormatRecord
private AreaFormatRecord
private AxisLineFormatRecord
private AxisOptionsRecord
private AxisParentRecord
private AxisRecord
createAxisRecord(short axisType)

private void
private AxisUsedRecord
createAxisUsedRecord(short numAxis)

public void
createBarChart(HSSFWorkbook workbook, HSSFSheet parentSheet)

Creates a bar chart.

private BarRecord
private BeginRecord
private BOFRecord
private LinkedDataRecord
private CategorySeriesAxisRecord
private ChartFormatRecord
private ChartRecord
createChartRecord(int x, int y, int width, int height)

private DataFormatRecord
private DefaultDataLabelTextPropertiesRecord
createDefaultTextRecord(short categoryDataType)

private DimensionsRecord
private LinkedDataRecord
private EndRecord
private FontBasisRecord
private FontBasisRecord
private FontIndexRecord
private FrameRecord
private FrameRecord
private HCenterRecord
private LegendRecord
private LineFormatRecord
createLineFormatRecord(boolean drawTicks)

private LineFormatRecord
private LinkedDataRecord
private UnknownRecord
private UnknownRecord
private PlotAreaRecord
private PlotGrowthRecord
createPlotGrowthRecord(int horizScale, int vertScale)

private PrintSetupRecord
private SCLRecord
createSCLRecord(short numerator, short denominator)

public HSSFChart.HSSFSeries
private SeriesIndexRecord
private SeriesRecord
private SeriesChartGroupIndexRecord
private SheetPropertiesRecord
private TextRecord
private TickRecord
private TickRecord
private LinkedDataRecord
private UnitsRecord
private TextRecord
private ValueRangeRecord
private LinkedDataRecord
private VCenterRecord
public int
getChartHeight()

Get the height of the chart.

public String
getChartTitle()

Returns the chart's title, if there is one, or null if not

public int
getChartWidth()

Get the width of the chart.

public int
getChartX()

Get the X offset of the chart

public int
getChartY()

Get the Y offset of the chart

public HSSFChart.HSSFSeries[]
getSeries()

Returns the series of the chart

public static HSSFChart[]
getSheetCharts(HSSFSheet sheet)

Returns all the charts for the given sheet.

public HSSFChart.HSSFChartType
public boolean
public void
setChartHeight(int height)

Sets the height of the chart.

public void
setChartTitle(String title)

Changes the chart's title, but only if there was one already.

public void
setChartWidth(int width)

Sets the width of the chart.

public void
setChartX(int x)

Sets the X offset of the chart

public void
setChartY(int y)

Sets the Y offset of the chart

public void
setValueRange(int
0 - primary axis, 1 - secondary axis
axisIndex
,
Double
minimum value; Double.NaN - automatic; null - no change
minimum
,
Double
maximum value; Double.NaN - automatic; null - no change
maximum
,
Double
major unit value; Double.NaN - automatic; null - no change
majorUnit
,
Double
minor unit value; Double.NaN - automatic; null - no change
minorUnit
)

Set value range (basic Axis Options)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chartRecordback to summary
private ChartRecord chartRecord
chartTitleFormatback to summary
private ChartTitleFormatRecord chartTitleFormat
Annotations
@SuppressWarnings:unused
chartTitleTextback to summary
private SeriesTextRecord chartTitleText
legendRecordback to summary
private LegendRecord legendRecord
seriesback to summary
private List<HSSFChart.HSSFSeries> series
sheetback to summary
private HSSFSheet sheet
typeback to summary
private HSSFChart.HSSFChartType type
valueRangesback to summary
private List<ValueRangeRecord> valueRanges

Constructor Detail

HSSFChartback to summary
private HSSFChart(HSSFSheet sheet, ChartRecord chartRecord)

Method Detail

createAllTextRecordback to summary
private TextRecord createAllTextRecord()
createAreaFormatRecord1back to summary
private AreaFormatRecord createAreaFormatRecord1()
createAreaFormatRecord2back to summary
private AreaFormatRecord createAreaFormatRecord2()
createAxisLineFormatRecordback to summary
private AxisLineFormatRecord createAxisLineFormatRecord(short format)
createAxisOptionsRecordback to summary
private AxisOptionsRecord createAxisOptionsRecord()
createAxisParentRecordback to summary
private AxisParentRecord createAxisParentRecord()
createAxisRecordback to summary
private AxisRecord createAxisRecord(short axisType)
createAxisRecordsback to summary
private void createAxisRecords(List<Record> records)
createAxisUsedRecordback to summary
private AxisUsedRecord createAxisUsedRecord(short numAxis)
createBarChartback to summary
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.

createBarRecordback to summary
private BarRecord createBarRecord()
createBeginRecordback to summary
private BeginRecord createBeginRecord()
createBOFRecordback to summary
private BOFRecord createBOFRecord()
createCategoriesLinkedDataRecordback to summary
private LinkedDataRecord createCategoriesLinkedDataRecord()
createCategorySeriesAxisRecordback to summary
private CategorySeriesAxisRecord createCategorySeriesAxisRecord()
createChartFormatRecordback to summary
private ChartFormatRecord createChartFormatRecord()
createChartRecordback to summary
private ChartRecord createChartRecord(int x, int y, int width, int height)
createDataFormatRecordback to summary
private DataFormatRecord createDataFormatRecord()
createDefaultTextRecordback to summary
private DefaultDataLabelTextPropertiesRecord createDefaultTextRecord(short categoryDataType)
createDimensionsRecordback to summary
private DimensionsRecord createDimensionsRecord()
createDirectLinkRecordback to summary
private LinkedDataRecord createDirectLinkRecord()
createEndRecordback to summary
private EndRecord createEndRecord()
createFontBasisRecord1back to summary
private FontBasisRecord createFontBasisRecord1()
createFontBasisRecord2back to summary
private FontBasisRecord createFontBasisRecord2()
createFontIndexRecordback to summary
private FontIndexRecord createFontIndexRecord(int index)
createFrameRecord1back to summary
private FrameRecord createFrameRecord1()
createFrameRecord2back to summary
private FrameRecord createFrameRecord2()
createHCenterRecordback to summary
private HCenterRecord createHCenterRecord()
createLegendRecordback to summary
private LegendRecord createLegendRecord()
createLineFormatRecordback to summary
private LineFormatRecord createLineFormatRecord(boolean drawTicks)
createLineFormatRecord2back to summary
private LineFormatRecord createLineFormatRecord2()
createLinkedDataRecordback to summary
private LinkedDataRecord createLinkedDataRecord()
createMSDrawingObjectRecordback to summary
private UnknownRecord createMSDrawingObjectRecord()
createOBJRecordback to summary
private UnknownRecord createOBJRecord()
createPlotAreaRecordback to summary
private PlotAreaRecord createPlotAreaRecord()
createPlotGrowthRecordback to summary
private PlotGrowthRecord createPlotGrowthRecord(int horizScale, int vertScale)
createPrintSetupRecordback to summary
private PrintSetupRecord createPrintSetupRecord()
createSCLRecordback to summary
private SCLRecord createSCLRecord(short numerator, short denominator)
createSeriesback to summary
public HSSFChart.HSSFSeries createSeries() throws Exception
createSeriesIndexRecordback to summary
private SeriesIndexRecord createSeriesIndexRecord(int index)
createSeriesRecordback to summary
private SeriesRecord createSeriesRecord()
createSeriesToChartGroupRecordback to summary
private SeriesChartGroupIndexRecord createSeriesToChartGroupRecord()
createSheetPropsRecordback to summary
private SheetPropertiesRecord createSheetPropsRecord()
createTextRecordback to summary
private TextRecord createTextRecord()
createTickRecord1back to summary
private TickRecord createTickRecord1()
createTickRecord2back to summary
private TickRecord createTickRecord2()
createTitleLinkedDataRecordback to summary
private LinkedDataRecord createTitleLinkedDataRecord()
createUnitsRecordback to summary
private UnitsRecord createUnitsRecord()
createUnknownTextRecordback to summary
private TextRecord createUnknownTextRecord()
createValueRangeRecordback to summary
private ValueRangeRecord createValueRangeRecord()
createValuesLinkedDataRecordback to summary
private LinkedDataRecord createValuesLinkedDataRecord()
createVCenterRecordback to summary
private VCenterRecord createVCenterRecord()
getChartHeightback to summary
public int getChartHeight()

Get the height of the chart. ChartRecord

getChartTitleback to summary
public String getChartTitle()

Returns the chart's title, if there is one, or null if not

getChartWidthback to summary
public int getChartWidth()

Get the width of the chart. ChartRecord

getChartXback to summary
public int getChartX()

Get the X offset of the chart

getChartYback to summary
public int getChartY()

Get the Y offset of the chart

getSeriesback to summary
public HSSFChart.HSSFSeries[] getSeries()

Returns the series of the chart

getSheetChartsback to summary
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

getTypeback to summary
public HSSFChart.HSSFChartType getType()
removeSeriesback to summary
public boolean removeSeries(HSSFChart.HSSFSeries remSeries)
setChartHeightback to summary
public void setChartHeight(int height)

Sets the height of the chart. ChartRecord

setChartTitleback to summary
public void setChartTitle(String title)

Changes the chart's title, but only if there was one already. TODO - add in the records if not

setChartWidthback to summary
public void setChartWidth(int width)

Sets the width of the chart. ChartRecord

setChartXback to summary
public void setChartX(int x)

Sets the X offset of the chart

setChartYback to summary
public void setChartY(int y)

Sets the Y offset of the chart

setValueRangeback to summary
public void setValueRange(int axisIndex, Double minimum, Double maximum, Double majorUnit, Double minorUnit)

Set value range (basic Axis Options)

Parameters
axisIndex:int

0 - primary axis, 1 - secondary axis

minimum:Double

minimum value; Double.NaN - automatic; null - no change

maximum:Double

maximum value; Double.NaN - automatic; null - no change

majorUnit:Double

major unit value; Double.NaN - automatic; null - no change

minorUnit:Double

minor unit value; Double.NaN - automatic; null - no change

org.apache.poi.hssf.usermodel back to summary

public sealed Enum HSSFChart.HSSFChartType

extends Enum<HSSFChart.HSSFChartType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final HSSFChart.HSSFChartType
public static final HSSFChart.HSSFChartType
public static final HSSFChart.HSSFChartType
public static final HSSFChart.HSSFChartType
public static final HSSFChart.HSSFChartType
public static final HSSFChart.HSSFChartType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract short
public static HSSFChart.HSSFChartType
public static HSSFChart.HSSFChartType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Areaback to summary
public static final HSSFChart.HSSFChartType Area
Barback to summary
public static final HSSFChart.HSSFChartType Bar
Lineback to summary
public static final HSSFChart.HSSFChartType Line
Pieback to summary
public static final HSSFChart.HSSFChartType Pie
Scatterback to summary
public static final HSSFChart.HSSFChartType Scatter
Unknownback to summary
public static final HSSFChart.HSSFChartType Unknown

Constructor Detail

HSSFChartTypeback to summary
private HSSFChartType()

Method Detail

getSidback to summary
public abstract short getSid()
valueOfback to summary
public static HSSFChart.HSSFChartType valueOf(String name)
valuesback to summary
public static HSSFChart.HSSFChartType[] values()
org.apache.poi.hssf.usermodel back to summary

public Class HSSFChart.HSSFSeries

extends Object
Class Inheritance

A series in a chart

Field Summary

Modifier and TypeField and Description
private LinkedDataRecord
private LinkedDataRecord
private LinkedDataRecord
private LinkedDataRecord
private SeriesRecord
private SeriesTextRecord

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public CellRangeAddressBase
private CellRangeAddressBase
getCellRange(LinkedDataRecord linkedDataRecord)

public LinkedDataRecord

Returns:

record with data category labels
getDataCategoryLabels
()

public LinkedDataRecord

Returns:

record with data names
getDataName
()

public LinkedDataRecord

Returns:

record with data secondary category labels
getDataSecondaryCategoryLabels
()

public LinkedDataRecord

Returns:

record with data values
getDataValues
()

public short
public SeriesRecord

Returns:

record with series
getSeries
()

public String
getSeriesTitle()

Returns the series' title, if there is one, or null if not

public CellRangeAddressBase
public short
pack-priv void
public void
public void
setSeriesTitle(String title)

Changes the series' title, but only if there was one already.

pack-priv void
public void
private Integer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataCategoryLabelsback to summary
private LinkedDataRecord dataCategoryLabels
dataNameback to summary
private LinkedDataRecord dataName
dataSecondaryCategoryLabelsback to summary
private LinkedDataRecord dataSecondaryCategoryLabels
dataValuesback to summary
private LinkedDataRecord dataValues
seriesback to summary
private SeriesRecord series
seriesTitleTextback to summary
private SeriesTextRecord seriesTitleText

Constructor Detail

HSSFSeriesback to summary
pack-priv HSSFSeries(SeriesRecord series)

Method Detail

getCategoryLabelsCellRangeback to summary
public CellRangeAddressBase getCategoryLabelsCellRange()
getCellRangeback to summary
private CellRangeAddressBase getCellRange(LinkedDataRecord linkedDataRecord)
getDataCategoryLabelsback to summary
public LinkedDataRecord getDataCategoryLabels()
Returns:LinkedDataRecord

record with data category labels

getDataNameback to summary
public LinkedDataRecord getDataName()
Returns:LinkedDataRecord

record with data names

getDataSecondaryCategoryLabelsback to summary
public LinkedDataRecord getDataSecondaryCategoryLabels()
Returns:LinkedDataRecord

record with data secondary category labels

getDataValuesback to summary
public LinkedDataRecord getDataValues()
Returns:LinkedDataRecord

record with data values

getNumValuesback to summary
public short getNumValues()
getSeriesback to summary
public SeriesRecord getSeries()
Returns:SeriesRecord

record with series

getSeriesTitleback to summary
public String getSeriesTitle()

Returns the series' title, if there is one, or null if not

getValuesCellRangeback to summary
public CellRangeAddressBase getValuesCellRange()
getValueTypeback to summary
public short getValueType()

See SeriesRecord

insertDataback to summary
pack-priv void insertData(LinkedDataRecord data)
setCategoryLabelsCellRangeback to summary
public void setCategoryLabelsCellRange(CellRangeAddressBase range)
setSeriesTitleback to summary
public void setSeriesTitle(String title)

Changes the series' title, but only if there was one already. TODO - add in the records if not

setSeriesTitleTextback to summary
pack-priv void setSeriesTitleText(SeriesTextRecord seriesTitleText)
setValuesCellRangeback to summary
public void setValuesCellRange(CellRangeAddressBase range)
setVerticalCellRangeback to summary
private Integer setVerticalCellRange(LinkedDataRecord linkedDataRecord, CellRangeAddressBase range)