EasyXLS
http://forum.easyxls.com/

next available row after adding chart to worksheet
http://forum.easyxls.com/viewtopic.php?f=11&t=1213
Page 1 of 1

Author:  apple [ Mon Jun 01, 2009 4:52 am ]
Post subject:  next available row after adding chart to worksheet

Hi, I need help with the following problem :
I need to add a chart to my WorkSheet. After the chart is generated, and added to the worksheet, how can I know which rows/columns are hidden behind this newly added chart ?
i.e. after adding the chart, I need to add more values to the rows that occur below the chart. So, how can I compute the next available row below my chart ?
Thanks in advance <- src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" />

Author:  daniela [ Mon Jun 01, 2009 7:22 am ]
Post subject: 

You can use the
ExcelChart.easy_getSeriesAt(index)
method to extract the series and
ExcelSeries.getValues() to see the row and columns behind the chart data.

Author:  daniela [ Mon Jun 01, 2009 7:25 am ]
Post subject: 

If you want the chart position in the spreadsheet, you can set the size of the chart, so the chart will be always in the same position.
ExcelChart.setSize(int chartWidth, int chartHeight)
ExcelChart.setLeftUpperCorner(int row, int column)

Author:  apple [ Tue Jun 02, 2009 1:20 am ]
Post subject: 

thanks Daniela !
but, let me rephrase my question :
I meant : is there any way of knowing the lower right corner (row & col) of the chart that I add to the worksheet ?

Author:  daniela [ Tue Jun 02, 2009 5:13 am ]
Post subject: 

If you know/set the chart size, you can calculate the lower row. The default row height is 17.
For the columns is more complicated. By default, the column width is adjusted to cell data content, so the column width is not fixed. But if you will set the column width for all columns, you can calculate the last column.

Author:  apple [ Tue Jun 02, 2009 5:40 am ]
Post subject: 

thanks Daniela !! <- src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" />
that should solve my problem.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/