property Bar.OverlaidGroup as String
Specifies the list of bars beside the current bar that may cover each other.

 TypeDescription 
   String A String expression that specifies the list of bars separated by , character that may cover each other.  
By default, the OverlaidGroup property is empty, so only bars of the same type, in the same item are displayed using a different offset, transparency, when they cross each other. Use the OverlaidGroup property to specify the list of bars that may cross each other and display using different vertical offset, transparency and so on. The OverlaidType property to specify how the bars that cover each other are displayed. Use the Overlaid property to specify a different parameter for specified overlaid type. Use the OverlaidType and Overlaid properties to display different the bars that laid over or cover other bars. 

The following VB sample, creates two new type of bars RTask and GTask from Task bar, and specify when they cross each other inside the item to be displayed using a different offset:

With G2antt1
	.DefaultItemHeight = 22
	.Columns.Add "Task"
	With .Chart
		.ResizeUnitScale = exHour
		.PaneWidth(False) = 48
		.FirstVisibleDate = #1/1/2001#
		With .Bars
			.Copy("Task","RTask").Color = 255
			.Copy("Task","GTask").Color = 65280
			With .Item("Task")
				.OverlaidType = exOverlaidBarsOffset or exOverlaidBarsTransparent
				.Overlaid(exOverlaidBarsTransparent) = 70
				.OverlaidGroup = "RTask,GTask"
			End With
		End With
	End With
	With .Items
		h = .AddItem("Task 1")
		.AddBar h,"Task",#1/4/2001#,#1/8/2001#,"A1"
		.AddBar h,"GTask",#1/7/2001#,#1/12/2001#,"A2"
		.AddBar h,"RTask",#1/10/2001#,#1/15/2001#,"A3"
	End With
End With

The following VB.NET sample, creates two new type of bars RTask and GTask from Task bar, and specify when they cross each other inside the item to be displayed using a different offset:

Dim h
With AxG2antt1
	.DefaultItemHeight = 22
	.Columns.Add "Task"
	With .Chart
		.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exHour
		.PaneWidth(False) = 48
		.FirstVisibleDate = #1/1/2001#
		With .Bars
			.Copy("Task","RTask").Color = 255
			.Copy("Task","GTask").Color = 65280
			With .Item("Task")
				.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsOffset or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsTransparent
				.Overlaid(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsTransparent) = 70
				.OverlaidGroup = "RTask,GTask"
			End With
		End With
	End With
	With .Items
		h = .AddItem("Task 1")
		.AddBar h,"Task",#1/4/2001#,#1/8/2001#,"A1"
		.AddBar h,"GTask",#1/7/2001#,#1/12/2001#,"A2"
		.AddBar h,"RTask",#1/10/2001#,#1/15/2001#,"A3"
	End With
End With

The following C# sample, creates two new type of bars RTask and GTask from Task bar, and specify when they cross each other inside the item to be displayed using a different offset:

axG2antt1.DefaultItemHeight = 22;
axG2antt1.Columns.Add("Task");
EXG2ANTTLib.Chart var_Chart = axG2antt1.Chart;
	var_Chart.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exHour;
	var_Chart.set_PaneWidth(false,48);
	var_Chart.FirstVisibleDate = "1/1/2001";
	EXG2ANTTLib.Bars var_Bars = var_Chart.Bars;
		var_Bars.Copy("Task","RTask").Color = 255;
		var_Bars.Copy("Task","GTask").Color = 65280;
		EXG2ANTTLib.Bar var_Bar = var_Bars["Task"];
			var_Bar.OverlaidType = (EXG2ANTTLib.OverlaidBarsTypeEnum)(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsOffset + EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsTransparent);
			var_Bar.set_Overlaid(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsTransparent,70);
			var_Bar.OverlaidGroup = "RTask,GTask";
EXG2ANTTLib.Items var_Items = axG2antt1.Items;
	int h = var_Items.AddItem("Task 1");
	var_Items.AddBar(h,"Task","1/4/2001","1/8/2001","A1",null);
	var_Items.AddBar(h,"GTask","1/7/2001","1/12/2001","A2",null);
	var_Items.AddBar(h,"RTask","1/10/2001","1/15/2001","A3",null);

The following C++ sample, creates two new type of bars RTask and GTask from Task bar, and specify when they cross each other inside the item to be displayed using a different offset:

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library'

	#import "D:\\Exontrol\\ExG2antt\\project\\Debug\\ExG2antt.dll"
	using namespace EXG2ANTTLib;
*/
EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown();
spG2antt1->PutDefaultItemHeight(22);
spG2antt1->GetColumns()->Add(L"Task");
EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart();
	var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour);
	var_Chart->PutPaneWidth(VARIANT_FALSE,48);
	var_Chart->PutFirstVisibleDate("1/1/2001");
	EXG2ANTTLib::IBarsPtr var_Bars = var_Chart->GetBars();
		var_Bars->Copy(L"Task",L"RTask")->PutColor(255);
		var_Bars->Copy(L"Task",L"GTask")->PutColor(65280);
		EXG2ANTTLib::IBarPtr var_Bar = var_Bars->GetItem("Task");
			var_Bar->PutOverlaidType((EXG2ANTTLib::OverlaidBarsTypeEnum)(EXG2ANTTLib::exOverlaidBarsOffset + EXG2ANTTLib::exOverlaidBarsTransparent));
			var_Bar->PutOverlaid(EXG2ANTTLib::exOverlaidBarsTransparent,long(70));
			var_Bar->PutOverlaidGroup(L"RTask,GTask");
EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems();
	long h = var_Items->AddItem("Task 1");
	var_Items->AddBar(h,"Task","1/4/2001","1/8/2001","A1",vtMissing);
	var_Items->AddBar(h,"GTask","1/7/2001","1/12/2001","A2",vtMissing);
	var_Items->AddBar(h,"RTask","1/10/2001","1/15/2001","A3",vtMissing);

The following VFP sample, creates two new type of bars RTask and GTask from Task bar, and specify when they cross each other inside the item to be displayed using a different offset:

with thisform.G2antt1
	.DefaultItemHeight = 22
	.Columns.Add("Task")
	with .Chart
		.ResizeUnitScale = 65536
		.PaneWidth(.F.) = 48
		.FirstVisibleDate = {^2001-1-1}
		with .Bars
			.Copy("Task","RTask").Color = 255
			.Copy("Task","GTask").Color = 65280
			with .Item("Task")
				.OverlaidType = 257
				.Overlaid(256) = 70
				.OverlaidGroup = "RTask,GTask"
			endwith
		endwith
	endwith
	with .Items
		h = .AddItem("Task 1")
		.AddBar(h,"Task",{^2001-1-4},{^2001-1-8},"A1")
		.AddBar(h,"GTask",{^2001-1-7},{^2001-1-12},"A2")
		.AddBar(h,"RTask",{^2001-1-10},{^2001-1-15},"A3")
	endwith
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.