You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Miguel Gómez <zu...@gmail.com> on 2011/01/17 10:16:57 UTC

Move chart in an excel sheet

Hi everybody,

I want to move a chart in an excel sheet with api poi 3.7. I have tried
this:

HSSFChart[] listChart = HSSFChart.getSheetCharts(wb.getSheetAt(0));

listChart[0].setChartX(400);
listChart[0].setChartY(600);

but it doesn´t work and my chart doesn´t move. In fact, the initial values
from X and Y are always 0.


Thanks and regards.

Re: Move chart in an excel sheet

Posted by doanquangviet <do...@gmail.com>.
I met the same problem.

I already changed X, Y, Width, Height, example:

HSSFChart[] chart = HSSFChart.getSheetCharts(sheet);
chart[0].setChartX(100);
chart[0].setChartHeight(500);

After saving this file, I opened again and checked, those values  were
saved, but no any change in layout.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Move-chart-in-an-excel-sheet-tp3344139p5150279.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Move chart in an excel sheet

Posted by Nick Burch <ni...@alfresco.com>.
On Mon, 17 Jan 2011, Miguel Gómez wrote:
> but it doesn´t work and my chart doesn´t move. In fact, the initial 
> values from X and Y are always 0.

I'd suggest you try creating two simple files, both with a similar chart 
but in different places. Next, use BiffViewer to identify what holds the 
positioning for the chart. Finally, take a look at the HSSFChart code 
(which is largely user contributed and a work in progress), and verify 
that it is updating the required records

Nick