Condividi tramite


Application.ResourceGraphBarStylesEx Method (Project)

Sets the styles of bars on the Resource Graph view, where colors can be hexadecimal values.

Version Information

Version Added: Project 2010

Syntax

expression .ResourceGraphBarStylesEx(TopLeftShowAs, TopLeftColor, TopLeftPattern, BottomLeftShowAs, BottomLeftColor, BottomLeftPattern, TopRightShowAs, TopRightColor, TopRightPattern, BottomRightShowAs, BottomRightColor, BottomRightPattern, ShowValues, ShowAvailabilityLine, PercentBarOverlap, ProposedLeftShowAs, ProposedLeftColor, ProposedLeftPattern, ProposedRightShowAs, ProposedRightColor, ProposedRightPattern)

expression An expression that returns an Application object.

Parameters

Name

Required/Optional

Data Type

Description

TopLeftShowAs

Optional

Integer

The bar type for the overallocated resources category in the upper-left corner of the Bar Styles dialog box. Can be one of the following PjResourceGraphStyle constants: pjBar, pjArea, pjStep, pjLine, pjStepLine, or pjDoNotShow.

TopLeftColor

Optional

Integer

The bar color for the overallocated resources category in the upper-left corner of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte. For example, the value &HFF0000 is blue and &H00FFFF is yellow.

TopLeftPattern

Optional

Integer

The bar pattern for the overallocated resources category in the upper-left corner of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

BottomLeftShowAs

Optional

Integer

The bar type for the allocated resources category (the middle left section) of the Bar Styles dialog box. Can be one of the PjResourceGraphStyle constants.

BottomLeftColor

Optional

Integer

The bar color for the allocated resources category (the middle left section) of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte. For example, the value &HFF00 is green.

BottomLeftPattern

Optional

Integer

The bar pattern for the allocated resources category (the middle left section) of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

TopRightShowAs

Optional

Integer

The bar type for the overallocated resources category in the upper-right corner of the Bar Styles dialog box. Can be one of the PjResourceGraphStyle constants.

TopRightColor

Optional

Integer

The bar color for the overallocated resources category in the upper-right corner of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte.

TopRightPattern

Optional

Integer

The bar pattern for the overallocated resources category in the upper-right corner of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

BottomRightShowAs

Optional

Integer

The bar type for the allocated resources category (the middle right section) of the Bar Styles dialog box. Can be one of the PjResourceGraphStyle constants.

BottomRightColor

Optional

Integer

The bar color for the allocated resources category (the middle right section) of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte.

BottomRightPattern

Optional

Integer

The bar pattern for the allocated resources category (the middle right section) of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

ShowValues

Optional

Boolean

True if the corresponding values appear below the bars.

ShowAvailabilityLine

Optional

Boolean

True if a horizontal line appears where a resource reaches its maximum availability.

PercentBarOverlap

Optional

Integer

A number from 0 to 100 that specifies the overlap percentage of displayed bars.

ProposedLeftShowAs

Optional

Integer

The bar type for the proposed bookings category in the bottom left section of the Bar Styles dialog box. Can be one of the PjResourceGraphStyle constants.

ProposedLeftColor

Optional

Integer

The bar color for the proposed bookings category in the bottom left section of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte.

ProposedLeftPattern

Optional

Integer

The bar pattern for the proposed bookings category in the bottom left section of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

ProposedRightShowAs

Optional

Integer

The bar type for the proposed bookings category in the bottom right section of the Bar Styles dialog box. Can be one of the PjResourceGraphStyle constants.

ProposedRightColor

Optional

Integer

The bar color for the proposed bookings category in the bottom right section of the Bar Styles dialog box. Can be a hexadecimal value, where red is the last byte.

ProposedRightPattern

Optional

Integer

The bar pattern for the proposed bookings category in the bottom right section of the Bar Styles dialog box. Can be one of the PjResourceGraphPattern constants.

Return Value

Boolean

Remarks

Using the ResourceGraphBarStylesEx method without specifying any arguments displays the Bar Styles dialog box.

Note

If you use any of the PjColor enumeration constants for the color parameters, the color will be nearly black. For example, the value of pjGreen is 9, which in the ResourceGraphBarStylesEx method is a very dark red. To use only the sixteen colors available with PjColor constants, use the ResourceGraphBarStyles method.

Example

The following line of code sets proposed resources in the Resource Graph view as a step line in a light blue-green color.

Application.ResourceGraphBarStylesEx ProposedRightShowAs:=pjStepLine, ProposedRightColor:=&HD0FF00