Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("DrawingTimeLine.vsdx"); ////////////// Modify time line /////////// startDate = new aspose.diagram.DateTime(2015, 8, 1); endDate = new aspose.diagram.DateTime(2016, 6, 1); fisYear = startDate; // Get page pageName = "Page-1"; page = diagram.getPages().getPage(pageName); timelineId = 1; timeline = diagram.getPages().getPage(pageName).getShapes().getShape(timelineId); xpos = timeline.getXForm().getPinX().getValue(); ypos = timeline.getXForm().getPinY().getValue(); // Add milestone milestoneMasterName = "2 triangle milestone"; // Add Master diagram.addMaster("Timeline.vss", milestoneMasterName); // Add Shape in Visio diagram using AddShape method milestoneShapeId = diagram.addShape(xpos, ypos, milestoneMasterName, 0); // Get the shape based on ID milestone = page.getShapes().getShape(milestoneShapeId); // Instantiate MilestoneHelper object milestoneHelper = new aspose.diagram.MilestoneHelper(milestone); // Set Milestone Date milestoneHelper.setMilestoneDate(new aspose.diagram.DateTime(2015, 8, 1)); // Set IsAutoUpdate to true milestoneHelper.setAutoUpdate(true); // RefreshMilesone of timeline shape milestoneHelper.refreshMilestone(timeline); diagram.save("out-RefreshMilestone.vsdx", aspose.diagram.SaveFileFormat.VSDX);
Constructor Summary |
---|
MilestoneHelper(shape)
|
Property Getters/Setters Summary | ||
---|---|---|
void | setDateFormat(value) | |
DateFormat of shape
|
||
void | setDateFormatString(value) | |
DateFormat string of shape
|
||
void | setAutoUpdate(value) | |
whether to update data for markers (milestones, intervals) as they are moved on timeline
|
||
method | getMilestoneDate() | |
method | setMilestoneDate(value) | |
Milestone date | ||
void | setType(value) | |
Type of shape
|
Method Summary | ||
---|---|---|
method | refreshMilestone(timeline) | |
Refresh milestone
|
DateTime getMilestoneDate() / setMilestoneDate(value)
setAutoUpdate(value)
setType(value)
setDateFormat(value)
Value | Format String |
0 | dddd, yyyy-M-d |
1 | yyyy-MM-dd |
2 | yy-MMM-d |
3 | yyyy/M/d |
4 | yy-MMM.-d |
5 | d MMMM yyyy |
6 | yy-M |
7 | MMM-yy |
8 | MMMM d, yyyy |
9 | MMM d, yyyy |
10 | M-d-yy |
11 | M-d |
12 | d MMMM, yyyy |
13 | d MMM, yyyy |
14 | d-M-yy |
15 | d-M |
16 | yy-M-d |
17 | yyyy-M-d |
18 | M-yy |
19 | M-yyyy |
20 | MMMM yyyy |
21 | MMMM yy |
22 | MMM yyyy |
23 | MMM yy |
24 | yy |
25 | yyyy |
26 | d |
27 | MMMM |
28 | MMM |
29 | M |
30 | MM/dd/yyyy |
setDateFormatString(value)