SheetAPI.insertFloatingItem method is used to insert floating item to the existing sheet tab. Currently, enterpriseSheet supports the following floating items: wedgit, chart, and image.
ParametersThe configuration object defines the parameters to be implemented for the floating items. See the following example for more details.
var wedgitJson = {
ftype: 'wedgit',
url: 'http://www.cubedrive.com'
};
var store = SHEET_API_HD.store;
SHEET_API.insertFloatingItem(SHEET_API_HD, store.getActivedSheetId(), wedgitJson);
The above example will insert a wedgit into the current active sheet tab. The config item only include those two parameters.
Name | Description |
---|---|
ftype: 'wedgit' | Name should be defined as 'wedgit'. |
url | The hyperlink of the insert wedgit. |
var imageJson = {
ftype: 'picture',
url: 'http://www.enterprisesheet.com/resources/images/enterpriseLogo.png'
};
var store = SHEET_API_HD.store;
SHEET_API.insertFloatingItem(SHEET_API_HD, store.getActivedSheetId(), imageJson);
The above example will insert an image into the current active sheet tab. The config item only include those two parameters.
Name | Description |
---|---|
ftype: 'picture' | Name should be defined as 'picture'. |
url | The hyperlink of the insert image. |
var chartJson = {
ftype: 'chart',
seriesPosition:'row',
legendPosition:'right',
chartType:'column',
source:{
series:[['',8,5,8,7],['',9,5,9,7],['',10,5,10,7],['',11,5,11,7]],
usAbs:false
},
x:370,
y:272,
width:400,
height:300
};
var store = SHEET_API_HD.store;
SHEET_API.insertFloatingItem(SHEET_API_HD, store.getActivedSheetId(), chartJson);
The above example will insert a chart into the current active sheet tab. The config item include those parameters.
Name | Description |
---|---|
ftype: 'chart' | Name should be defined as 'chart'. |
seriesPosition:'row' | Chart series position: row or column |
legendPosition:'right' | Where legend should be: right, left, top, bottom |
chartType:'column' | Different kind of chart |
"xTitle":"X" | OPTION - ignore this if chart does not have X title |
"yTitle":"Y" | OPTION - ignore this if chart does not have Y title |
source:{...} | The source information for the chart. Includes the following items:
|
"x":695 | the chart located X position |
"y":164 | the chart located Y position |
"width":400 | the chart width |
"height":300 | the chart height |