SetDataBorderColors — Set the rectangle border color on bars and stacked bars
$plot->SetDataBorderColors($border
)
SetDataBorderColors
sets the colors used for the
borders of the bars and stacked bars for plot types 'bars' and
'stackedbars'. By default, the borders are only drawn if shading is turned off
with SetShading.
Shaded bar and stackedbar plots do not use data borders by default.
$border
An array of color values, one for the bar border of each data set. Or, a single color value (not an array) to use for all data sets. For other possibilities, see Notes. See Section 3.5, “Colors” for more on color values.
If an array is used for $border
, it
must use zero-based sequential integer indexes.
If this function is never called, a default color map is used which sets all data borders to black.
Data border colors are only used used for plot types 'bars' and 'stackedbars'.
By default, unshaded plots (SetShading(0)
)
have data borders, and shaded plots have a 3D-look and no data borders.
If you want unshaded plots with no data borders, use
SetDrawDataBorders(FALSE)
to disable
the borders. You can enable data borders on shaded plots with
SetDrawDataBorders(TRUE)
.
The data border colors can also be used to outline the color boxes in a legend. See SetLegendColorboxBorders for this option.
If $border
is not an array, but a single color
value, then that color will be used for all data sets.
However, the array(r,g,b) notation is not allowed in
this case (because it looks like an array of 3 separate color values).
You can get around this restriction if you want to specify a single color
as an R, G, B array by wrapping the array in another array, for example:
array(array(102, 0, 192))
.
Two special uses of the $border
argument
are available.
If the argument is an empty string, or boolean False, the color map is reset
to the defaults. This can be used to restore the default color map.
If the argument is NULL or missing from the function call, the color map is
reset to the defaults, but only if it has not already been set.
This is used internal to PHPlot for one-time initialization.
A data colors callback, as described in Section 4.5, “Custom Data Color Selection”, also controls selection of the color for data borders (if used).