Databases Reference
In-Depth Information
In case 1, the interval range is greater than the color step range. As a practical matter, there
are more steps in the data range than the color range, which means some colors must be reused.
In case 2, which is ideal, the number of color steps exactly equals the span of the interval range.
Therefore, if the colors are mapped linearly, there will be exactly one color for each step in the
range, and no colors will have to be either reused or discarded. (As a practical matter in life, this
has about zero probability of occurring.) The last case, case 3, results when the interval range has
fewer members than the number of color steps. In such an instance, the number of color steps
utilized must be decimated. These cases apply when the mapping done is by means of a linear
method. The nature of nonlinear mapping assures that colors will be both reused and decimated
because the color range will be stretched out in one area and compressed in another.
A sample windowing application utilizing linear and nonlinear mapping functions has been
created. This sample applies such a mapping down a column specified by the user. The range in
which the mapping occurs can be specified by the user in one of three ways:
1.
The range can span a percentage of a specified number.
2.
The range can be
±
a specified number.
3.
The range can span the entire range of numbers in the column.
In case 1 and case 2, the range is centered around a specified number. The sample application
allows the user to specify that number in one of two ways. The user may point to a number within
the Worksheet via a RefEdit control, or the user may specify a particular number via a textbox
located in the GUI. The user may select which means to pick the specific number by pushing a
button that toggles between the possible states of a textbox or a RefEdit control. In the case of
option 3, the range is specified by finding the minimum and maximum values within the specified
column to be acted upon. In such an instance, the textbox and RefEdit control are grayed out as
they would not be utilized. The minimum and maximum in any column can easily be determined
by means of the following functions.
Function MaxValinColX(Workbook, Worksheet, columnX As Integer)
MaxValinColX =
Application.Max(Workbooks(Workbook).Worksheets(Worksheet).Ran
ge(Cells(1, columnX), Cells(Rows.Count, columnX)))
End Function
Function MinValinColX(Workbook, Worksheet, columnX As Integer)
MinValinColX =
Application.Min(Workbooks(Workbook).Worksheets(Worksheet).Ran
ge(Cells(1, columnX), Cells(Rows.Count, columnX)))
End Function
In case 1 and case 2, it would be advantageous to have the ability to dynamically change the
center value. For instance, it would be lucrative to have the ability to change the center value by
taking values down a column specified by the RefEdit Control. In the static instance, a single center
value is used specified by the RefEdit Control. When the dynamic option is chosen, the center value
will change down the column specified, starting with the row position identified in the RefEdit control.
The final consideration is the color scheme utilized for the mapping function. The Combo boxes
show the colors in the order that they appear in the color spectrum. When the initial color is picked,
the final colors are limited to only those that follow after the initial color. However, this may or
may not be the order in which they should appear. For instance, the color order is as follows: Black,
Red, Yellow, Green, Cyan, Blue, Magenta, White. If the user were to pick Red as the initial color,
their selection would be limited to the following colors as the final color in the gradient: Yellow,
Search WWH ::




Custom Search