Type | Description | |||
Color | A Color expression that indicates the color for the ending part of the bar. |
The following VB sample changes the "Task" bar visual appearance using liner gradient with margins as shown :
With G2antt1.Chart.Bars.Item("Task") .Color = vbWhite .Pattern = exPatternBox .StartShape = exShapeIconCircleDot .StartColor = vbRed .EndShape = exShapeIconCircleDot .EndColor = vbBlue End With
The following VB sample changes the "Task" bar visual appearance using liner gradient with solid border as shown :
With G2antt1.Chart.Bars.Item("Task") .Color = vbRed .Pattern = exPatternBox .StartColor = vbRed .EndColor = vbBlue End With
The following VB sample defines a new bar that looks like this :
With G2antt1.Chart.Bars.Add("Task2") .Pattern = exPatternShadow .Color = RGB(0, 0, 255) .EndShape = exShapeIconCircleDot .EndColor = RGB(255, 0, 0) End With
The following C++ sample defines a bar that looks like this above:
CBar bar = m_g2antt.GetChart().GetBars().Add("Task2"); bar.SetPattern( 3 /*exPatternShadow*/ ); bar.SetColor( RGB(0, 0, 255) ); bar.SetEndShape( 4 /* exShapeIconCircleDot*/ ); bar.SetEndColor( RGB(255, 0, 0) );
The following VB.NET sample defines a bar that looks like this above:
With AxG2antt1.Chart.Bars.Add("Task2") .Pattern = EXG2ANTTLib.PatternEnum.exPatternShadow .Color = RGB(0, 0, 255) .EndShape = EXG2ANTTLib.ShapeCornerEnum.exShapeIconCircleDot .EndColor = RGB(255, 0, 0) End With
The following VB.NET sample adds a custom icon to the start of all Task bars:
With AxG2antt1.Chart.Bars .AddShapeCorner(12345, 1) .Item("Task").StartShape = 12345 .Item("Task").StartColor = UInteger.MaxValue End With
The following C# sample defines a bar that looks like this above:
EXG2ANTTLib.Bar bar = axG2antt1.Chart.Bars.Add("Task2"); bar.Pattern = EXG2ANTTLib.PatternEnum.exPatternShadow; bar.Color = ToUInt32(Color.FromArgb(0, 0, 255)); bar.EndShape = EXG2ANTTLib.ShapeCornerEnum.exShapeIconCircleDot; bar.EndColor = ToUInt32(Color.FromArgb(255, 0, 0));
The following C# sample adds a custom icon to the start of all Task bars:
EXG2ANTTLib.Bars bars = axG2antt1.Chart.Bars; bars.AddShapeCorner(12345, 1); bars["Task"].StartShape = EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty + 12345; bars["Task"].StartColor = 0xFFFFFFFF;
The following VFP sample defines a bar that looks like this above:
with thisform.G2antt1.Chart.Bars.Add("Task2") .Pattern = 3 && exPatternShadow .Color = RGB(0, 0, 255) .EndShape = 4 && exShapeIconCircleDot .EndColor = RGB(255, 0, 0) EndWith
In VB.NET or C# you require the following functions until the .NET framework will provide:
Shared Function ToUInt32(ByVal c As Color) As UInt32 Dim i As Long i = c.R i = i + 256 * c.G i = i + 256 * 256 * c.B ToUInt32 = Convert.ToUInt32(i) End Function
private UInt32 ToUInt32(Color c) { long i; i = c.R; i = i + 256 * c.G; i = i + 256 * 256 * c.B; return Convert.ToUInt32(i); }