property InsideZoomFormat.InsideUnit as UnitEnum
Retrieves or sets a value that indicates the unit of the inside level.

 TypeDescription 
   UnitEnum A UnitEnum expression that specifies the time scale unit being used to display the inside units.   
By default, the InsideUnit property is exHour. Use the InsideUnit property to change the inside zoom scale once the user magnify a time in the chart's base level. The InsideCount property specifies the number on inside units being displayed at one time.   The InsideLabel property defines the label being displayed in the unit's header. For instance, if the InsideUnit is exHour, and InsideCount property is 1, the inside level displays if possible, the level from hour to hour. If the InsideCount property 4, the level displays the level from 4 hours in 4 hours. The InsideLabel and InsideUnit properties define also the resizing unit while the user creates, moves or resizes a bar. Use the ResizeUnitScale and ResizeUnitCount properties to specify the resizing unit in the chart.  

The following screen shot splits the time scale chart, and displays different sections using different time scale units ( the chart displays months, the January displays weeks, while the March displays days ): 

The following screen shot shows the chart displays week numbers:

 

The following screen shot shows the week days once a week gets expanded/magnified ( the chart displays weeks ):

 

The following VB sample shows how can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days ):
With G2antt1
	.BeginUpdate 
	With .Chart
		.ShowNonworkingDates = False
		.PaneWidth(0) = 0
		.LevelCount = 2
		With .Level(0)
			.Label = "<%mmmm%>"
			.Unit = exMonth
		End With
		With .Level(1)
			.Label = "<%ww%>"
			.Unit = exWeek
		End With
		.FirstVisibleDate = #1/1/2008#
		.AllowInsideZoom = True
		With .DefaultInsideZoomFormat
			.OwnerLabel = "<font ;7><%mmm%> Week: <%ww%>"
			.InsideLabel = "<font ;7><b><%d1%></b>"
			.InsideUnit = exDay
		End With
		With .InsideZooms
			.SplitBaseLevel = False
			.Add #2/3/2008#
		End With
	End With
	.EndUpdate 
End With
The following VB.NET sample shows how can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days ):
With AxG2antt1
	.BeginUpdate 
	With .Chart
		.ShowNonworkingDates = False
		.PaneWidth(0) = 0
		.LevelCount = 2
		With .Level(0)
			.Label = "<%mmmm%>"
			.Unit = EXG2ANTTLib.UnitEnum.exMonth
		End With
		With .Level(1)
			.Label = "<%ww%>"
			.Unit = EXG2ANTTLib.UnitEnum.exWeek
		End With
		.FirstVisibleDate = #1/1/2008#
		.AllowInsideZoom = True
		With .DefaultInsideZoomFormat
			.OwnerLabel = "<font ;7><%mmm%> Week: <%ww%>"
			.InsideLabel = "<font ;7><b><%d1%></b>"
			.InsideUnit = EXG2ANTTLib.UnitEnum.exDay
		End With
		With .InsideZooms
			.SplitBaseLevel = False
			.Add #2/3/2008#
		End With
	End With
	.EndUpdate 
End With
The following C++ sample shows how can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days ):
/*
	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 <ExG2antt.dll>
	using namespace EXG2ANTTLib;
*/
EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown();
spG2antt1->BeginUpdate();
EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart();
	var_Chart->PutShowNonworkingDates(VARIANT_FALSE);
	var_Chart->PutPaneWidth(0,0);
	var_Chart->PutLevelCount(2);
	EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0);
		var_Level->PutLabel("<%mmmm%>");
		var_Level->PutUnit(EXG2ANTTLib::exMonth);
	EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1);
		var_Level1->PutLabel("<%ww%>");
		var_Level1->PutUnit(EXG2ANTTLib::exWeek);
	var_Chart->PutFirstVisibleDate("1/1/2008");
	var_Chart->PutAllowInsideZoom(VARIANT_TRUE);
	EXG2ANTTLib::IInsideZoomFormatPtr var_InsideZoomFormat = var_Chart->GetDefaultInsideZoomFormat();
		var_InsideZoomFormat->PutOwnerLabel(L"<font ;7><%mmm%> Week: <%ww%>");
		var_InsideZoomFormat->PutInsideLabel(L"<font ;7><b><%d1%></b>");
		var_InsideZoomFormat->PutInsideUnit(EXG2ANTTLib::exDay);
	EXG2ANTTLib::IInsideZoomsPtr var_InsideZooms = var_Chart->GetInsideZooms();
		var_InsideZooms->PutSplitBaseLevel(VARIANT_FALSE);
		var_InsideZooms->Add("2/3/2008");
spG2antt1->EndUpdate();
The following C# sample shows how can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days ):
axG2antt1.BeginUpdate();
EXG2ANTTLib.Chart var_Chart = axG2antt1.Chart;
	var_Chart.ShowNonworkingDates = false;
	var_Chart.set_PaneWidth(0 != 0,0);
	var_Chart.LevelCount = 2;
	EXG2ANTTLib.Level var_Level = var_Chart.get_Level(0);
		var_Level.Label = "<%mmmm%>";
		var_Level.Unit = EXG2ANTTLib.UnitEnum.exMonth;
	EXG2ANTTLib.Level var_Level1 = var_Chart.get_Level(1);
		var_Level1.Label = "<%ww%>";
		var_Level1.Unit = EXG2ANTTLib.UnitEnum.exWeek;
	var_Chart.FirstVisibleDate = "1/1/2008";
	var_Chart.AllowInsideZoom = true;
	EXG2ANTTLib.InsideZoomFormat var_InsideZoomFormat = var_Chart.DefaultInsideZoomFormat;
		var_InsideZoomFormat.OwnerLabel = "<font ;7><%mmm%> Week: <%ww%>";
		var_InsideZoomFormat.InsideLabel = "<font ;7><b><%d1%></b>";
		var_InsideZoomFormat.InsideUnit = EXG2ANTTLib.UnitEnum.exDay;
	EXG2ANTTLib.InsideZooms var_InsideZooms = var_Chart.InsideZooms;
		var_InsideZooms.SplitBaseLevel = false;
		var_InsideZooms.Add("2/3/2008");
axG2antt1.EndUpdate();
The following VFP sample shows how can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days ):
with thisform.G2antt1
	.BeginUpdate
	with .Chart
		.ShowNonworkingDates = .F.
		.PaneWidth(0) = 0
		.LevelCount = 2
		with .Level(0)
			.Label = "<%mmmm%>"
			.Unit = 16
		endwith
		with .Level(1)
			.Label = "<%ww%>"
			.Unit = 256
		endwith
		.FirstVisibleDate = {^2008-1-1}
		.AllowInsideZoom = .T.
		with .DefaultInsideZoomFormat
			.OwnerLabel = "<font ;7><%mmm%> Week: <%ww%>"
			.InsideLabel = "<font ;7><b><%d1%></b>"
			.InsideUnit = 4096
		endwith
		with .InsideZooms
			.SplitBaseLevel = .F.
			.Add({^2008-2-3})
		endwith
	endwith
	.EndUpdate
endwith

 


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