ChartDirector 6.0 (Ruby Edition)

BaseChart.setTransparentColor


Usage

setTransparentColor(c)

Description

Specifies a certain color to mean transparent when creating a raster image output.

There are two types of transparency:

When outputting the image, to reduce image size, ChartDirector will include the alpha channel only if the chart background is a transparent or semi-transparent. You may pass -1 to setTransparentColor to force ChartDirector to include the alpha channel in the output.

Note that including alpha channel is possible only if the image format supports alpha channel. The PNG, SVG and PDF formats support alpha transparency, while the JPG, GIF and BMP formats does not support it.

Although the GIF format does not support alpha transparency, it does support single color transparency. The setTransparentColor method can be used to specify which color should be used to mean completely transparent.

Arguments

ArgumentDefaultDescription
c(Mandatory)The color that is designated as the transparent color. If -1 is used, the alpha channel will be included in the final output if the output image format supports it.

Return Value

None