GanttBarFillPattern Enumeration

A shape's fill pattern.

Namespace:  Aspose.Tasks.Visualization
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public enum GanttBarFillPattern
Members
  Member nameValueDescription
Hollow0 Hollow pattern.
SolidFill1 Solid fill pattern.
LightFill2 Light fill pattern.
MediumFill3 Medium fill pattern.
DarkFill4 Dark fill pattern.
DiagonalLeft5 Diagonal left pattern (from the upper left to the lower right).
DiagonalRight6 Diagonal right pattern (from the upper right to the lower left).
DiagonalCross7 Diagonal cross pattern.
LineVertical8 Line vertical pattern.
LineHorizontal9 Line horizontal pattern.
LineCross10 Line cross pattern.
SolidFillWithDashedBorder11 Solid 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);

        var 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