ChartDirector 7.0 (Perl Edition)

AngularMeter.relativeRadialGradient


Usage

relativeRadialGradient(gradient [, radius ])

Description

Creates a radial gradient color relative to the meter center and radius.

A general radial gradient color can be created by BaseChart.radialGradientColor2, which involves specifying the center x and y coordinates, horizontal and vertical radii, and the color stops. The relativeRadialGradient simplifies creating a radial gradient by assuming the center of the radial gradient to be the meter center, and the radial pattern is circular (so that the vertical and horizontal radii are the same), and default to using the meter scale radius (set by AngularMeter.setMeter) as the reference radius.

The radial gradient is defined using an array of numbers, in which each pair of numbers represents the relative radius and its associated color. The relative radius is the ratio of the absolute radius to the reference radius.

For example, to define a radial gradient with blue (0000FF) at the center, green (00FF00) at the mid-point between the center and the reference radius, and red at the reference radius, the numbers should be:

0.0, 0x0000ff, 0.5, 0x00ff00, 1.0, 0xff0000

The relative radii in the array must be arranged in increasing order. It is possible to define a relative radial gradient smaller or larger than the reference radius by using a relative radius smaller or greater than 1.

Arguments

ArgumentDefaultDescription
gradient(Mandatory)An numeric array defining the color stops. Please refer to the description above for details.
radius-1The reference radius of the radial gradient. The default is the meter scale radius (set by AngularMeter.setMeter).

Return Value

A 32-bit integer representing the radial gradient color.