class
MilestoneHelper
Source: aspose.
MilestoneHelper to set property of milestone shape.
new MilestoneHelper()
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);
Methods
getMilestoneDate()
Milestone date
refreshMilestone()
Refresh milestone
setAutoUpdate()
whether to update data for markers (milestones, intervals) as they are moved on timeline
setDateFormat()
DateFormat of shape Value Format String 0dddd, yyyy-M-d1yyyy-MM-dd2yy-MMM-d3yyyy/M/d4yy-MMM.-d5d MMMM yyyy6yy-M7MMM-yy8MMMM d, yyyy9MMM d, yyyy10M-d-yy11M-d12d MMMM, yyyy13d MMM, yyyy14d-M-yy15d-M16yy-M-d17yyyy-M-d18M-yy19M-yyyy20MMMM yyyy21MMMM yy22MMM yyyy23MMM yy24yy25yyyy26d27MMMM28MMM29M30MM/dd/yyyy
setDateFormatString()
DateFormat string of shape
setType()
Type of shape