Package org.apache.poi.hssf.usermodel
Class HSSFChart
java.lang.Object
org.apache.poi.hssf.usermodel.HSSFChart
Has methods for construction of a chart object.
- Author:
- Glen Stampoultzis (glens at apache.org)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classA series in a chart -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateBarChart(HSSFWorkbook workbook, HSSFSheet parentSheet) Creates a bar chart.intGet the height of the chart.Returns the chart's title, if there is one, or null if notintGet the width of the chart.intGet the X offset of the chartintGet the Y offset of the chartReturns the series of the chartstatic HSSFChart[]getSheetCharts(HSSFSheet sheet) Returns all the charts for the given sheet.getType()booleanremoveSeries(HSSFChart.HSSFSeries remSeries) voidsetChartHeight(int height) Sets the height of the chart.voidsetChartTitle(String title) Changes the chart's title, but only if there was one already.voidsetChartWidth(int width) Sets the width of the chart.voidsetChartX(int x) Sets the X offset of the chartvoidsetChartY(int y) Sets the Y offset of the chartvoidsetValueRange(int axisIndex, Double minimum, Double maximum, Double majorUnit, Double minorUnit) Set value range (basic Axis Options)
-
Method Details
-
createBarChart
Creates a bar chart. API needs some work. :)NOTE: Does not yet work... checking it in just so others can take a look.
-
getSheetCharts
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
Returns the series of the chart -
getChartTitle
Returns the chart's title, if there is one, or null if not -
setChartTitle
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
- Throws:
Exception
-
removeSeries
-
getType
-