java.lang.Object
com.aspose.cells.Timeline
public class Timeline
- extends java.lang.Object
summary description of Timeline View
Example:
Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.get(0, 0).setValue("fruit");
cells.get(1, 0).setValue("grape");
cells.get(2, 0).setValue("blueberry");
cells.get(3, 0).setValue("kiwi");
cells.get(4, 0).setValue("cherry");
//Create date style
Style dateStyle = new CellsFactory().createStyle();
dateStyle.setCustom("m/d/yyyy");
cells.get(0, 1).setValue("date");
cells.get(1, 1).setValue(new DateTime(2021, 2, 5));
cells.get(2, 1).setValue(new DateTime(2022, 3, 8));
cells.get(3, 1).setValue(new DateTime(2023, 4, 10));
cells.get(4, 1).setValue(new DateTime(2024, 5, 16));
//Set date style
cells.get(1, 1).setStyle(dateStyle);
cells.get(2, 1).setStyle(dateStyle);
cells.get(3, 1).setStyle(dateStyle);
cells.get(4, 1).setStyle(dateStyle);
cells.get(0, 2).setValue("amount");
cells.get(1, 2).setValue(50);
cells.get(2, 2).setValue(60);
cells.get(3, 2).setValue(70);
cells.get(4, 2).setValue(80);
PivotTableCollection pivots = sheet.getPivotTables();
//Add a PivotTable
int pivotIndex = pivots.add("=Sheet1!A1:C5", "A12", "TestPivotTable");
PivotTable pivot = pivots.get(pivotIndex);
pivot.addFieldToArea(PivotFieldType.ROW, "fruit");
pivot.addFieldToArea(PivotFieldType.COLUMN, "date");
pivot.addFieldToArea(PivotFieldType.DATA, "amount");
pivot.setPivotTableStyleType(PivotTableStyleType.PIVOT_TABLE_STYLE_MEDIUM_10);
//Refresh PivotTable data
pivot.refreshData();
pivot.calculateData();
//Add a new Timeline using PivotTable as data source
sheet.getTimelines().add(pivot, 10, 5, "date");
//Get Timeline object
Timeline timelineObj = sheet.getTimelines().get(0);
book.save("out.xlsx");
//do your business
|
Property Getters/Setters Summary |
java.lang.String | getCaption() | |
void | setCaption(java.lang.String) | |
|
Returns or sets the caption of the specified Timeline.
|
int | getHeightPixel() | |
void | setHeightPixel(int) | |
|
Returns or sets the height of the specified timeline, in pixels.
|
int | getLeftPixel() | |
void | setLeftPixel(int) | |
|
Returns or sets the horizontal offset of timeline shape from its left column, in pixels.
|
java.lang.String | getName() | |
void | setName(java.lang.String) | |
|
Returns or sets the name of the specified Timeline
|
int | getTopPixel() | |
void | setTopPixel(int) | |
|
Returns or sets the vertical offset of timeline shape from its top row, in pixels.
|
int | getWidthPixel() | |
void | setWidthPixel(int) | |
|
Returns or sets the width of the specified timeline, in pixels.
|
|
Property Getters/Setters Detail |
getCaption/setCaption | |
public java.lang.String getCaption() / public void setCaption(java.lang.String value)
|
-
Returns or sets the caption of the specified Timeline.
Example:
//Set the caption of the specified Timeline.
timelineObj.setCaption("timeline caption test");
setCaption | |
public void setCaption(java.lang.String value)
|
-
Returns or sets the caption of the specified Timeline.
Example:
//Set the caption of the specified Timeline.
timelineObj.setCaption("timeline caption test");
getName/setName | |
public java.lang.String getName() / public void setName(java.lang.String value)
|
-
Returns or sets the name of the specified Timeline
Example:
//Set the name of the specified Timeline.
timelineObj.setName("timeline name test");
setName | |
public void setName(java.lang.String value)
|
-
Returns or sets the name of the specified Timeline
Example:
//Set the name of the specified Timeline.
timelineObj.setName("timeline name test");
getLeftPixel/setLeftPixel | |
public int getLeftPixel() / public void setLeftPixel(int value)
|
-
Returns or sets the horizontal offset of timeline shape from its left column, in pixels.
setLeftPixel | |
public void setLeftPixel(int value)
|
-
Returns or sets the horizontal offset of timeline shape from its left column, in pixels.
getTopPixel/setTopPixel | |
public int getTopPixel() / public void setTopPixel(int value)
|
-
Returns or sets the vertical offset of timeline shape from its top row, in pixels.
setTopPixel | |
public void setTopPixel(int value)
|
-
Returns or sets the vertical offset of timeline shape from its top row, in pixels.
getWidthPixel/setWidthPixel | |
public int getWidthPixel() / public void setWidthPixel(int value)
|
-
Returns or sets the width of the specified timeline, in pixels.
setWidthPixel | |
public void setWidthPixel(int value)
|
-
Returns or sets the width of the specified timeline, in pixels.
getHeightPixel/setHeightPixel | |
public int getHeightPixel() / public void setHeightPixel(int value)
|
-
Returns or sets the height of the specified timeline, in pixels.
setHeightPixel | |
public void setHeightPixel(int value)
|
-
Returns or sets the height of the specified timeline, in pixels.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.