NtPerspective

The NtTimeChartControl is made to display data of various data types. The way how data is being shown is determined by three layers:
 
1. The Application: The application determines the basic layout: How many legends (NtFlankControls) does my Time Chart have? Will category header texts be shown and how? These things are basic settings that are defined at design time and will hardly change at runtime.
 
2. The Display Definitions: One NtDisplayDef has to exist for each data type. It determines if data is being drawn as courve, icon, text, custom drawn etc. It also determines the colors (background and foreground) for the Row Header and the data itself and several more things that are specific to one data type. These settings are loaded dynamically when preparing the data set for display. A good point in time is the Form initialization phase (Load() method of the Form e.g.). Once these settings are done, they will hardly change throughout the use of the Form. Imagine if a certain type of information is said to be displayed as icons, then this will be kept during one run of the Form.
 
3. The Perspective: The Perspective is the current view of the data: It defines which data types are show in which row (and if a certain data type is currently shown at all), which legend (Row Header) is currently associated with which data type and what the current Category setup is (are there any categories at all, which of them are open, which are closed?). The Perspective can be changed at any time while showing the Time Chart: If you want to show only some of the data, your application can switch to a Perspective that arrange only this. Or if the user prefers another order of the rows, he can drag rows vertically and thereby change the current Perspective. And users can open and close categories at any time.
So the Perspective changes frequently and can can be read from the NtTimeChartControl (method GetNtPerspective() to save the current status of the view or it can be replaced to change the view.
 
Please take a look onto the image below: It describes how the same data is being shown by two different NtPerspectives: The plain data rows with no categories to the left. And categories and a different row order on the right. Again: Neither colors, fonts nor the data display type are being affected. All data types are allways shown in their typical ways not matter what Perspective is being used. Perspectives are just about row orders and category organization.


 
In other words:

Please see the illustration below about the nesting of Perspecitves, NtRowPerspectives and data types:


Please note that within the Time Chart row indices start with 0 for the topmost row.

Class Hierarchy:

System.Object

NtPerspective

Methods and Properties:

Modifier / Return Value Name and Parameters Description
public NtPerspective Clone ( ) This creates a clone of this NtPerspective. This method is used by the NtTimeChartControl when you query the currently active NtPerspective. You will not get the active NtPerspective itself but a clone of it. So if you change it arbitrarily you do not influence the display. Only after activating your Perspective by calling your Time Charts's SetNtPerspective() method you will change the view.
public int GetRow ( int dataTypeId ) This helper function allows you to find out which row currently holds the data of type dataTypeId. It will return -1 in case you provide a dataTypeId for which there is no row defined in the NtPerspective.
public int GetCategory ( int row ) This helper function allows you to find out the parent category of the row. Will return -1 if there is none.
This is needed for advanced programming of the NtTimeChartControl, only. Normally you do not use it.
public int GetClosingCategoryRow ( int row ) This helper function allows you to find out the closing category of the row. This is not necessarily the parent category: Suppose there are several categories nested into each others and they are all open. If the user now closes the topmost category, then the 'closing category' of a data row is not the parent category of the row but the topmost category.
This is needed for advanced programming of the NtTimeChartControl, only. Normally you do not use it.
public int GetTopmostClosingCategory ( int row ) This helper function allows you to find out the topmost closing category of the row. Suppose there are several categories nested into each other and they are all closed. Then this member returns the topmost of the closed categories. This is used internally to find out which category row has to display the so called 'category lines' for a certain row of data.
This is needed for advanced programming of the NtTimeChartControl, only. Normally you do not use it.
public void Normalize ( ) Normalizing a NtPerspective means to ensure that all category levels are enumerated continously starting by zero. So if you define a toplevel category with level 5 and a subcategory with level 25 then calling Normalize() will renumber them to 0 and 1. It is used internally by the NtTimeChartControl. In general applications hardly need to call it.

Members:

Type Name Description
public int maxCategoryLevel After calling Normalize() the member maxCategoryLevel holds the highest category level this NtPerspective defines.
This is needed for advanced programming of the NtTimeChartControl, only. Normally you do not use it.
public List<NtRowPerspective> rowPerspecives For each row it wants to define the NtPerspective holds one NtRowPerspective object in this list. It is the NtRowPerspectives which finally define the rows of the NtTimeChartControl.
When creating a NtPerspective you create one NtRowPerspective per row and simply add it to this member.

See also:

NtRowPerspective