SetPlotBorderType
Prev | PHPlot Function Reference | Next

## SetPlotBorderType

SetPlotBorderType — Control how much of a border is drawn around the plot

## Synopsis

    $plot->SetPlotBorderType($pbt)

## Description

`SetPlotBorderType` controls how much of a border is drawn around the plot.

## Parameters

`$pbt`

  A string or array indicating where to draw the plot borders. If a string, it must be one of the following values:

  Value | Description
  --- | ---
  bottom | Border on bottom plot
  full | Border on all four sides of the plot
  left | Border on left side of plot
  none | No plot area border
  right | Border on right side of plot
  sides | Border on left and right sides of plot
  top | Border on top of plot

  An array of strings can be used. Each element in the array must be one of the above values. For example, use either `array('left', 'right', 'bottom')` or `array('sides', 'bottom')` to get a plot border on the sides and bottom but not the top.

## Notes

By default, left and right side borders are drawn for all plot types except pie charts. For pie charts, no borders are drawn by default.

Plot border color is set by SetGridColor (this color also applies to the axes and other elements). The default color is black.

The X and Y axis lines and the plot border are all drawn in the same color. Usually, the X axis line is drawn at the bottom of the plot area, and the Y axis line is drawn on the left side of the plot area. (See SetXAxisPosition and SetYAxisPosition for more information on the axis positions.) Enabling or disabling a plot border edge that corresponds to an axis line will have no visible effect because the axis line will be drawn there.

The preceding paragraph does not apply to pie charts, which do not have axis lines.

## History

Through PHPlot-5.5.0, plot area borders were not available for pie charts, and the default border type was always 'sides'. Starting with PHPlot-5.6.0, pie charts can also have plot area borders. The default plot area border type is 'none' for pie charts, and 'sides' for all other plot types.

Through PHPlot-5.1.1, the available choices were 'left', 'sides', 'full', or 'none', and only a single string option was supported. Starting with PHPlot-5.1.2, the additional choices 'right', 'top', and 'bottom' were added, as well as the ability to pass an array of choices.

Prev | Up | Next
SetPlotBgColor | Home | SetPlotType