ChartDirector 7.0 (Python Edition)

pychartdir.cylinderEffect


Usage

cylinderEffect([ orientation [, ambientIntensity, diffuseIntensity, specularIntensity, shininess ]])

Description

A special shading effect that emulates the lighting of a cylinder surface.

This effect adjusts the brightness of the color of a rectangular box to make it look like cylindrical. The brightness is adjusted as according to the Phong lighting model, in which the light source is from the viewer direction and is far away.

The cylinderEffect method returns an integer representing this effect. The integer can be used as the third argument to Box.setBackground to apply the effect to Box objects (including derived objects such as TextBox objects). It may also be used as the second argument to Layer.setBorderColor for BarLayer or BoxWhiskerLayer objects to apply the effect to bars or boxes.

This effect is automatically used for cylindrical bars in a BarLayer. You may use this method to adjust the lighting parameters by using its return value as the second argument to Layer.setBorderColor.

Arguments

ArgumentDefaultDescription
orientationCenterThe orientation of the cylinder.

A value of Top or Bottom means the cylinder is vertical. A value of Left or Right means the cylinder is horizontal.

A value of Center means the orientation is automatically determined. For a BarLayer or BoxWhiskerLayer, the orientation will be the same as the orientation of the bars or boxes. For other objects (eg. TextBox objects), if the object height is bigger than its width, the cylinder will be treated as vertical, otherwise it will be treated as horizontal.
ambientIntensity0.5The ambient reflection coefficient of the Phong lighting model.
diffuseIntensity0.5The diffuse reflection coefficient of the Phong lighting model.
specularIntensity0.75The specular reflection coefficient of the Phong lighting model.
shininess8The shininess coefficient of the Phong lighting model.

Return Value

An integer representing the cylinder effect.