GanttBarFillPattern

GanttBarFillPattern enumeration

A shape’s fill pattern.

public enum GanttBarFillPattern

Values

NameValueDescription
Hollow0Hollow pattern.
SolidFill1Solid fill pattern.
LightFill2Light fill pattern.
MediumFill3Medium fill pattern.
DarkFill4Dark fill pattern.
DiagonalLeft5Diagonal left pattern (from the upper left to the lower right).
DiagonalRight6Diagonal right pattern (from the upper right to the lower left).
DiagonalCross7Diagonal cross pattern.
LineVertical8Line vertical pattern.
LineHorizontal9Line horizontal pattern.
LineCross10Line cross pattern.
SolidFillWithDashedBorder11Solid with dashed border pattern.

Examples

Shows how to set custom bar styles of Gantt Chart project view.

public void ImplementCustomBarStyle()
{
    try
    {
        var project = new Project(DataDir + "Blank2010.mpp");
        project.RootTask.Children.Add("Task");

        var view = (GanttChartView)project.DefaultView;
        var custom = GetCustomBarStyle();

        // Add the custom bar style to the custom bar collection of the project view
        view.CustomBarStyles.Add(custom);

        SimpleSaveOptions options = new MPPSaveOptions
        {
            WriteViewData = true
        };

        project.Save(OutDir + "ImplementCustomBarStyleWriting_out.mpp", options);
    }
    catch (NotSupportedException ex)
    {
        Console.WriteLine(
            ex.Message
            + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx.");
    }
}

public static GanttBarStyle GetCustomBarStyle()
{
    var style = new GanttBarStyle
    {
        ShowForTaskUid = 1,
        MiddleShape = GanttBarMiddleShape.RectangleBottom,
        MiddleFillPattern = GanttBarFillPattern.MediumFill,
        MiddleShapeColor = Color.Blue,

        StartShape = GanttBarEndShape.ArrowDown,
        StartShapeColor = Color.Red,

        EndShape = GanttBarEndShape.ArrowUp,
        EndShapeColor = Color.Yellow,

        LeftField = Field.TaskResourceNames,
        RightField = Field.TaskName,
        TopField = Field.TaskStart,
        BottomField = Field.TaskFinish,
        InsideField = Field.TaskDuration
    };

    return style;
}

See Also