]> source.dussan.org Git - poi.git/commitdiff
X, Y, Width and Height getters/setters on HSSFChart
authorNick Burch <nick@apache.org>
Tue, 27 May 2008 11:44:49 +0000 (11:44 +0000)
committerNick Burch <nick@apache.org>
Tue, 27 May 2008 11:44:49 +0000 (11:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@660474 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java
src/scratchpad/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java

index 5b48501938bf0863e51cf6094cbb92d107f050c8..e3f5bb23e92a2a8d825ffc6f2c2fdf372e33a66f 100644 (file)
@@ -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
index 184d46d2fe2008e9e650c766745ffadd0e6fb335..d28b8a8777fc0a73287e2336ea5982650e4f0d2c 100644 (file)
@@ -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 {