A special shading effect for rectangular and polygonal bars on a BarLayer
. It shades all surfaces of a 2D or 3D bar with gradient colors.
For the front surface of a bar, the gradient is from base line of the bar to the end of the bar. For example, for a vertical bar pointing upwards, the gradient is from bottom to the top. Similarly, for a horizontal bar pointing rightwards, the gradient is from left to right.
For a 3D bar, the gradient for the top surface of a vertical bar or the right surface of a horizontal bar is from front to back. The gradients for the side surfaces are the same as for the front surface.
The gradient is specified with two brightness values at the gradient end points. A brightness less than 1 means the color is darkened, while a brightness greater than 1 means the color is brightened. For example, a brightness of 0.5 means the color is half as bright as the original color. If the original color is red, the color will become dark red. Conversely, a brightness of 2 means the color is twice as bright as the original color. If the original color is red, the color will become light red.
The followings are some examples demonstrating this effect.
|Gradient Bar Chart||A 2D horizontal bar chart using the barLighting effect, with the brightness at the end points being 0.75 and 2.0.
|Gradient Multi-Bar Chart||A 3D vertical bar chart using the barLighting effect, with the brightness at the end points being 0.75 and 1.75.
The barLighting method returns an integer representing this effect. The integer can be used as the second argument to Layer.setBorderColor
objects to apply the effect to bars or boxes.
© 2021 Advanced Software Engineering Limited. All rights reserved.