Chapter 10. PHPlot Class Member Variables
Prev | Part III. Developer's Guide to PHPlot | Next

## Chapter 10. PHPlot Class Member Variables

This chapter provides information about the PHPlot class member variables.

All PHPlot class member variables are meant for internal use only, although they are declared as public. You may use these in applications, but they are subject to change in future releases without concern for backward compatibility.

Section 4.5, “Tuning Parameters” describes how some of these PHPlot variables can be used to adjust plot appearance. Although these are also internal variables, setting them from your script is generally safe, as they have relatively small effects on plots, and are less likely to change in future releases.

## 10.1. List of Member Variables

The table below lists the PHPlot class member variables. If the variable is declared at the top of the PHPlot class definition, the initial value is listed under Initialized to Value. If nothing is listed under Initialized to Value, this means the variable is defined only when needed, and is not declared at the top of the PHPlot class definition. The Reference Function column lists the member function(s) used to set the variable, if the variable can be set by the application, else the member function which calculates the variable, if there is one, else the member function(s) which use the variable, if there are only a few.

Variable Name: | Initialized to Value: | Reference Function: | Description:
--- | --- | --- | ---
actual_bar_width |  | CalcBarWidths | Calculated width of bars for bar charts
bar_adjust_gap |  | CalcBarWidths | Calculated bar gap
bar_extra_space | 0.5 | CalcBarWidths | Extra space between groups of bars (See Tuning Parameters for more)
bar_width_adjust | 1 | CalcBarWidths | Width of bar relative to space for one bar (See Tuning Parameters for more)
bg_color | 'white' | SetBackgroundColor | Color (R,G,B,A) for image background
bgimg |  | SetBgImage | Background image filename
bgmode |  | SetBgImage | Background image tiling mode
browser_cache | FALSE | SetBrowserCache | Flag: Don't send cache suppression headers
callbacks | array(...) | SetCallback | Callback (hook) function information. Indexed by callback reason; value is an array of function name and pass-through argument if the callback is in use, else NULL.
color_array | 'small' | PHPlot | Name of the initial color map
dashed_grid | TRUE | SetDrawDashedGrid | Flag: Draw dashed or solid grid lines?
dashed_style | '2-4' | SetDefaultStyles | Initial dashed pattern code
data |  | SetDataValues | The data array
data_border_colors | 'black' | SetDataBorderColors | Array of colors (R,G,B,A) for bar chart data borders.
data_colors |  | SetDataColors | Array of colors (R,G,B,A) for data lines/marks/bars/etc. See default_colors for initial value.
data_columns |  | CheckDataArray | Maximum number of dependent variable values (usually Y values, or pie slices) in the data array rows. (Added in PHPlot-5.1.3)
data_max |  | FindDataLimits | Array: Per row maximum Y value. (Before PHPlot-5.1.2 this was named data_maxy.)
data_min |  | FindDataLimits | Array: Per row minimum Y value. (Before PHPlot-5.1.2 this was named data_miny.)
data_type | 'text-data' | SetDataType | Format of the data array
datatype_error_bars |  | DecodeDataType | Flag: data type has error bars. (Added in PHPlot-5.1.3)
datatype_implied |  | DecodeDataType | Flag: data type has implied X or Y. (Added in PHPlot-5.1.3)
datatype_pie_single |  | DecodeDataType | Flag: data type is one-column data for pie chart with one slice per row. (Added in PHPlot-5.1.3)
datatype_swapped_xy |  | DecodeDataType | Flag: data type has swapped X and Y values. (Added in PHPlot-5.1.3)
data_units_text | '' | FormatLabel | Obsolete - suffix for 'data'-formatted labels
data_value_label_angle |  | CheckDataValueLabels | Angle (in degrees) for data value labels (See Tuning Parameters for more)
data_value_label_distance |  | CheckDataValueLabels | Distance (in pixels) for data value labels (See Tuning Parameters for more)
decimal_point |  | SetNumberFormat | Character to use for decimal point in formatted numbers
default_colors | array(...) | SetDataColors, SetErrorBarColors | The default color array, used to initialize data_colors and error_bar_colors. (Added in PHPlot-5.1.0)
default_dashed_style |  | SetDefaultDashedStyle | Formatted PHP code to build a dashed line pattern
default_ttfont |  | SetDefaultTTFont, GetDefaultTTFont | Default TrueType font file. (Through PHPlot-5.1.2, there was a static default 'benjamingothic.ttf'. After PHPlot-5.1.2, the default is dynamic.)
done |  | DrawBackground, DrawImageBorder, DrawTitle | Array of flags for elements that must be drawn at most once. Flag is set TRUE when drawn. Indexes are: background, border, title. (Replaced separate variables in PHPlot-5.3.1.)
draw_broken_lines | FALSE | SetDrawBrokenLines | Flag: How to handle missing Y values
draw_plot_area_background | FALSE | SetDrawPlotAreaBackground | Flag: Draw the background of the plot area
draw_x_data_label_lines | FALSE | SetDrawXDataLabelLines | Flag: Draw X data label lines
draw_x_grid |  | SetDrawXGrid, CalcGridSettings | Flag: Draw X grid lines?
draw_y_grid |  | SetDrawYGrid, CalcGridSettings | Flag: Draw Y grid lines?
error_bar_colors |  | SetErrorBarColors | Array of colors (R,G,B,A) for error bars. See default_colors for initial value.
error_bar_line_width | 1 | SetErrorBarLineWidth | Thickness of error bar lines
error_bar_shape | 'tee' | SetErrorBarShape | Shape (style) of error bars: line or tee
error_bar_size | 5 | SetErrorBarSize | Size of error bars
file_format | 'png' | SetFileFormat | Image format: png, gif, jpg, wbmp
fonts |  | SetFontGD, SetFontTTF | Array of font information. (See notes for more)
grid_at_foreground | FALSE | DrawGraph | Flag: Draw grid on top of or behind the plot (See Tuning Parameters for more)
grid_color | 'black' | SetGridColor | Color (R,G,B,A) to use for axes, plot area border, legend border, pie chart lines and text (not grid!)
group_frac_width | 0.7 | CalcBarWidths | Controls fraction of bar group space used for bar (See Tuning Parameters for more)
i_border | array(194, 194 ,194) | SetImageBorderColor | Color (R,G,B,A) for image border, if drawn
image_border_type | 'none' | SetImageBorderType | Image border type
image_border_width |  | SetImageBorderWidth | Width of image border in pixels. Default depends on image_border_type. (Added in PHPlot-5.1.2)
image_height |  | PHPlot | Image height
image_width |  | PHPlot | Image width
img |  | PHPlot | Image resource
in_error |  | PrintError | Prevent recursion in error message image production
is_inline | FALSE | SetIsInline | Don't sent headers
label_format | array(...) | SetXLabelType, SetYLabelType, SetXDataLabelType, SetYDataLabelType, SetXTimeFormat, SetYTimeFormat, SetPrecisionX, SetPrecisionY | Label format info. (See notes for more)
label_scale_position | 0.5 | SetLabelScalePosition | Pie chart label position factor
legend | '' | SetLegend | Legend text array. Each index is a legend text line.
legend_colorbox_align |  | SetLegendStyle | Legend alignment of color boxes, left, right, or none
legend_colorbox_width |  | DrawLegend | Adjusts width of color boxes in the legend (See Tuning Parameters for more) (Added in PHPlot-5.3.0)
legend_text_align |  | SetLegendStyle | Legend style setting, left or right
legend_x_pos |  | SetLegendPixels, SetLegendWorld | Forced legend position
legend_xy_world |  | SetLegendPixels, SetLegendWorld | Flag indicating legend position was set in World coords
legend_y_pos |  | SetLegendPixels, SetLegendWorld | Forced legend position
light_grid_color | 'gray' | SetLightGridColor | Color (R,G,B,A) for grid lines and X data lines
line_spacing | 4 | SetLineSpacing | Controls inter-line spacing of text
line_styles | array(...) | SetLineStyles | Plot line style(s)
line_widths | 1 | SetLineWidths | Plot line width(s)
locale_override |  | number_format | Flag to avoid importing locale info (See Tuning Parameters for more)
max_x |  | FindDataLimits | Overall max X value in the data array
max_y |  | FindDataLimits | Overall max Y value in the data array
min_x |  | FindDataLimits | Overall min X value in the data array
min_y |  | FindDataLimits | Overall min Y value in the data array
ndx_bg_color |  | SetColorIndexes | Color index of image background
ndx_data_border_colors |  | SetColorIndexes | Color index array for bar chart data borders
ndx_data_colors |  | SetColorIndexes | Color index array for plot data lines/marks/bars/etc.
ndx_data_dark_colors |  | NeedDataDarkColors | Color index array for plot data, darker shade
ndx_error_bar_colors |  | NeedErrorBarColors | Color index array for error bars
ndx_grid_color |  | SetColorIndexes | Color index for axes, plot area border, legend border, pie chart lines and text
ndx_i_border |  | SetColorIndexes | Color index for image border lines
ndx_i_border_dark |  | SetColorIndexes | Color index for image border lines, darker shade
ndx_light_grid_color |  | SetColorIndexes | Color index for grid lines and X data lines
ndx_plot_bg_color |  | SetColorIndexes | Color index of plot area background
ndx_text_color |  | SetColorIndexes | Color index for labels and legend text
ndx_tick_color |  | SetColorIndexes | Color index for tick marks
ndx_title_color |  | SetColorIndexes | Color index for main title
ndx_x_title_color |  | SetColorIndexes | Color index for X title (Added in PHPlot-5.2.0)
ndx_y_title_color |  | SetColorIndexes | Color index for Y title (Added in PHPlot-5.2.0)
num_data_rows |  | SetDataValues | Number of rows in the data array (number of points along X, or number of bar groups, for example)
num_recs |  | SetDataValues | Array with number of entries in each data row (including label and X if present)
num_x_ticks | '' | SetNumXTicks | Forced number of X tick marks
num_y_ticks | '' | SetNumYTicks | Forced number of Y tick marks
ohlc_min_width |  | DrawOHLC | Minimum half-width for elements in OHLC plots (candlestick bodies or tick pairs). Default is 2 pixels. (See Tuning Parameters for more) (Added in PHPlot-5.3.0)
ohlc_max_width |  | DrawOHLC | Maximum half-width for elements in OHLC plots (candlestick bodies or tick pairs). Default is 8 pixels. (See Tuning Parameters for more) (Added in PHPlot-5.3.0)
ohlc_frac_width |  | DrawOHLC | Scale factor for element widths in OHLC plots. Default is 0.3, meaning within min and max limits the elements will use 30% of the available space for half their width. (See Tuning Parameters for more) (Added in PHPlot-5.3.0)
output_file | '' | SetOutputFile | Redirect to output file
plot_area |  | CalcPlotAreaPixels | Array defining the calculated plot area. ([0],[1]) is the top left corner, ([2],[3]) is the bottom right corner.
plot_area_height |  | CalcPlotAreaPixels | Height of the plot area
plot_area_width |  | CalcPlotAreaPixels | Width of the plot area
plot_bg_color | 'white' | SetPlotBgColor | Color (R,G,B,A) for plot area background
plot_border_type | 'sides' | SetPlotBorderType | Where to draw plot borders. Can be scalar or array of choices.
plot_max_x |  | SetPlotAreaWorld, CalcPlotAreaWorld | Max X of the plot area in world coordinates
plot_max_y |  | SetPlotAreaWorld, CalcPlotAreaWorld | Max Y of the plot area in world coordinates
plot_min_x |  | SetPlotAreaWorld, CalcPlotAreaWorld | Min X of the plot area in world coordinates
plot_min_y |  | SetPlotAreaWorld, CalcPlotAreaWorld | Min Y of the plot area in world coordinates
plot_origin_x |  | CalcTranslation | X device coordinate of the plot area origin
plot_origin_y |  | CalcTranslation | Y device coordinate of the plot area origin
plot_type | 'linepoints' | SetPlotType | Selected plot type
plotbgimg |  | SetPlotAreaBgImage | Plot area background image filename
plotbgmode |  | SetPlotAreaBgImage | Plot area background image tiling mode
plots | array(...) | DrawGraph, SetPlotType, FindDataLimits | Static array of plot type information (Added in PHPlot-5.3.0) (See notes for more)
point_counts |  | CheckPointParams | Size of point_shapes and point_sizes arrays (added in PHPlot-5.1.0)
point_shapes | array(...) | SetPointShapes | Marker shapes for point plots
point_sizes | array(...) | SetPointSizes | Marker sizes for point plots
print_image | TRUE | SetPrintImage | Flag: Automatic PrintImage after DrawGraph?
record_bar_width |  | CalcBarWidths | Area for each bar in a bar chart
records_per_group |  | SetDataValues | Maximum of num_recs[], max number of entries (including label and X if present) for all data rows
rgb_array |  | SetRGBArray | Array mapping color names to array of R, G, B values
safe_margin | 5 |  | Fixed extra margin used in multiple places (See Tuning Parameters for more)
shading | 5 | SetShading | Drop shadow size for pie and bar charts
skip_bottom_tick | FALSE | SetSkipBottomTick | Skip bottom tick mark
skip_left_tick | FALSE | SetSkipLeftTick | Skip left tick mark
skip_right_tick | FALSE | SetSkipRightTick | Skip right tick mark
skip_top_tick | FALSE | SetSkipTopTick | Skip top tick mark
suppress_x_axis |  | SetDrawXAxis | Flag: Don't draw the X axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
suppress_y_axis |  | SetDrawYAxis | Flag: Don't draw the Y axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
text_color | 'black' | SetTextColor | Color (R,G,B,A) for labels and legend text
thousands_sep |  | SetNumberFormat | Character to use to group 1000s in formatted numbers
tick_color | 'black' | SetTickColor | Color (R,G,B,A) for tick marks
title_color | 'black' | SetTitleColor | Color (R,G,B,A) for main title (and default for X and Y titles)
title_offset |  | CalcMargins | Y offset of main title position (Added in PHPlot-5.1.2)
title_txt | '' | SetTitle | Main title text
total_records |  | SetDataValues | Total number of entries (rows times columns in each row) in the data array.
transparent_color |  | SetTransparentColor | Color (R,G,B,A) designated as transparent (Added in PHPlot-5.2.0)
ttf_path | '.' | SetTTFPath | TrueType font directory
use_ttf | FALSE | SetUseTTF | Default font type, True for TrueType, False for GD
x_axis_position | '' | SetXAxisPosition | Position of X axis (in world coordinates)
x_axis_y_pixels |  | CalcTranslation | Device coordinate for the X axis
x_data_label_angle |  | SetXDataLabelAngle | X data label text angle (Added in PHPlot-5.1.0)
x_data_label_pos |  | SetXDataLabelPos | Position of X data labels. (Default was 'plotdown', but is now applied at graph drawing time.)
x_label_angle | 0 | SetXLabelAngle | X tick label text angle (and default for x_data_label_angle)
x_label_axis_offset |  | CalcMargins | Label offset relative to plot area
x_label_bot_offset |  | CalcMargins | Label offset relative to plot area
x_label_top_offset |  | CalcMargins | Label offset relative to plot area
x_left_margin |  | CalcMargins | Calculated plot area margin - left side
x_right_margin |  | CalcMargins | Calculated plot area margin - right side
x_tick_cross | 3 | SetXTickCrossing | Length of X tick marks (inside plot area)
x_tick_inc | '' | SetXTickIncrement | Step between X tick marks
x_tick_label_pos |  | SetXTickLabelPos | Position of X tick labels. (Default was 'plotdown', but is now applied at graph drawing time.)
x_tick_length | 5 | SetXTickLength | Length of X tick marks (outside plot area)
x_tick_pos | 'plotdown' | SetXTickPos | Position of X tick marks
x_title_bot_offset |  | CalcMargins | Title offset relative to plot area
x_title_color |  | SetXTitleColor | Color (R,G,B,A) for X title (Added in PHPlot-5.2.0)
x_title_pos | 'plotdown' | SetXTitle | X Axis title position
x_title_top_offset |  | CalcMargins | Title offset relative to plot area
x_title_txt | '' | SetXTitle | X Axis title text
xscale |  | CalcTranslation | X scale factor for converting World to Device coordinates
xscale_type | 'linear' | SetXScaleType | Linear or log scale on X
y_axis_position | '' | SetYAxisPosition | Position of Y axis (in world coordinates)
y_axis_x_pixels |  | CalcTranslation | Device coordinate for the Y axis
y_bot_margin |  | CalcMargins | Calculated plot area margin - bottom
y_data_label_angle | 0 | SetYDataLabelAngle | Y data label text angle (Added in PHPlot-5.1.0)
y_data_label_pos |  | SetYDataLabelPos, CheckLabels | Position of Y labels above bars
y_label_angle | 0 | SetYLabelAngle | Y tick label text angle
y_label_axis_offset |  | CalcMargins | Label offset relative to plot area
y_label_left_offset |  | CalcMargins | Label offset relative to plot area
y_label_right_offset |  | CalcMargins | Label offset relative to plot area
y_tick_cross | 3 | SetYTickCrossing | Length of Y tick marks (inside plot area)
y_tick_inc | '' | SetYTickIncrement | Step between Y tick marks
y_tick_label_pos |  | SetYTickLabelPos, CheckLabels | Position of Y tick labels
y_tick_length | 5 | SetYTickLength | Length of Y tick marks (outside plot area)
y_tick_pos | 'plotleft' | SetYTickPos | Position of Y tick marks
y_title_color |  | SetYTitleColor | Color (R,G,B,A) for Y title (Added in PHPlot-5.2.0)
y_title_left_offset |  | CalcMargins | Title offset relative to plot area
y_title_pos | 'plotleft' | SetYTitle | Y Axis title position
y_title_right_offset |  | CalcMargins | Title offset relative to plot area
y_title_txt | '' | SetYTitle | Y Axis title text
y_top_margin |  | CalcMargins | Calculated plot area margin - top
yscale |  | CalcTranslation | Y scale factor for converting World to Device coordinates
yscale_type | 'linear' | SetYScaleType | Linear or log scale on Y

Prev | Up | Next
Chapter 9. PHPlot Class Internal Functions | Home | 10.2. Member Variable Notes