asposediagram.api

Class MilestoneHelper

MilestoneHelper to set property of milestone shape.

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
 
Property Getters/Setters Summary
voidsetDateFormat(value)
DateFormat of shape
voidsetDateFormatString(value)
DateFormat string of shape
voidsetAutoUpdate(value)
whether to update data for markers (milestones, intervals) as they are moved on timeline
methodgetMilestoneDate()
method
           Milestone date
voidsetType(value)
Type of shape
 
Method Summary
methodrefreshMilestone(timeline)
Refresh milestone
 

    • Constructor Detail

      • MilestoneHelper

        MilestoneHelper(shape)
    • Property Getters/Setters Detail

      • getMilestoneDate/setMilestoneDate : DateTime 

        DateTime getMilestoneDate() / setMilestoneDate(value)
        
        Milestone date
      • setAutoUpdate : boolean 

        setAutoUpdate(value)
        
        whether to update data for markers (milestones, intervals) as they are moved on timeline
      • setType : int 

        setType(value)
        
        Type of shape
      • setDateFormat : int 

        setDateFormat(value)
        
        DateFormat of shape
        Value Format String 
        0dddd, yyyy-M-d
        1yyyy-MM-dd
        2yy-MMM-d
        3yyyy/M/d
        4yy-MMM.-d
        5d MMMM yyyy
        6yy-M
        7MMM-yy
        8MMMM d, yyyy
        9MMM d, yyyy
        10M-d-yy
        11M-d
        12d MMMM, yyyy
        13d MMM, yyyy
        14d-M-yy
        15d-M
        16yy-M-d
        17yyyy-M-d
        18M-yy
        19M-yyyy
        20MMMM yyyy
        21MMMM yy
        22MMM yyyy
        23MMM yy
        24yy
        25yyyy
        26d
        27MMMM
        28MMM
        29M
        30MM/dd/yyyy
      • setDateFormatString : String 

        setDateFormatString(value)
        
        DateFormat string of shape
    • Method Detail

      • refreshMilestone

         refreshMilestone(timeline)
        Refresh milestone