Delete Chart"

From Documentation
(Created page with "{{ZKSpreadsheetEssentialsPageHeader}} {{ZSS EE}} __TOC__ ===Purpose=== ZK Spreadsheet uses <javadoc directory="zss" method="deleteChart (org.zkoss.poi.ss.usermodel.Chart)">org....")
 
Line 1: Line 1:
 
{{ZKSpreadsheetEssentialsPageHeader}}
 
{{ZKSpreadsheetEssentialsPageHeader}}
 +
 +
{{Deprecated|url=http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials}}
 +
 +
 
{{ZSS EE}}
 
{{ZSS EE}}
  

Revision as of 06:40, 22 August 2013


Stop.png This article is out of date, please refer to http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials for more up to date information.


Available in ZK Spreadsheet EE only

Purpose

ZK Spreadsheet uses Range.deleteChart (Chart) to delete a chart from the sheet.

ZUML

<window vflex="1" width="100%" 
	apply="org.zkoss.zssessentials.config.DeleteChartComposer">
    <spreadsheet id="myss" src="/WEB-INF/excel/config/DeleteChart.xlsx" maxrows="200"
        maxcolumns="40" vflex="1" width="100%">
    </spreadsheet>
    <button id="delete" label="Delete All Charts"/>
</window>

Composer

ZK Spreadsheet use Worksheet.getCharts() to retrieve all charts in the sheet.

	private Spreadsheet myss;
	
	public void onClick$delete(MouseEvent evt) throws Exception {
		//delete all charts
		Worksheet sheet = myss.getSelectedSheet();
		Range rng = Ranges.range(sheet);
		for(Chart chart : sheet.getCharts()) {
			rng.deleteChart(chart);
		}
	}

View the complete source of ZUML deleteChart.zul

View the complete source of composer DeleteChartComposer.java

Version History

Last Update : 2013/08/22


Version Date Content
2.2.0 Nov. 14, 2011 API to delete a chart
     


All source code listed in this book is at Github.


Last Update : 2013/08/22

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.