diff --git a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java index 5b4850193..e3f5bb23e 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java +++ b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java @@ -213,6 +213,23 @@ public class HSSFChart charts.toArray( new HSSFChart[charts.size()] ); } + /** Get the X offset of the chart */ + public int getChartX() { return chartRecord.getX(); } + /** Get the Y offset of the chart */ + public int getChartY() { return chartRecord.getY(); } + /** Get the width of the chart. {@link ChartRecord} */ + public int getChartWidth() { return chartRecord.getWidth(); } + /** Get the height of the chart. {@link ChartRecord} */ + public int getChartHeight() { return chartRecord.getHeight(); } + + /** Sets the X offset of the chart */ + public void setChartX(int x) { chartRecord.setX(x); } + /** Sets the Y offset of the chart */ + public void setChartY(int y) { chartRecord.setY(y); } + /** Sets the width of the chart. {@link ChartRecord} */ + public void setChartWidth(int width) { chartRecord.setWidth(width); } + /** Sets the height of the chart. {@link ChartRecord} */ + public void setChartHeight(int height) { chartRecord.setHeight(height); } /** * Returns the series of the chart diff --git a/src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java b/src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java index 184d46d2f..d28b8a877 100644 --- a/src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java +++ b/src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java @@ -53,6 +53,12 @@ public class TestHSSFChart extends TestCase { assertEquals("1st Column", charts[0].getSeries()[0].getSeriesTitle()); assertEquals("2nd Column", charts[0].getSeries()[1].getSeriesTitle()); assertEquals(null, charts[0].getChartTitle()); + + // Check x, y, width, height + assertEquals(0, charts[0].getChartX()); + assertEquals(0, charts[0].getChartY()); + assertEquals(26492928, charts[0].getChartWidth()); + assertEquals(15040512, charts[0].getChartHeight()); } public void testTwoCharts() throws Exception {