Chapter 10. PHPlot Class Member Variables

This chapter provides information about the PHPlot class member variables and constants.

Most PHPlot class member variables are meant for internal use only, and are declared to have protected visibility (starting with PHPlot-6.0.0). This means they are not accessible from your application, unless you define a class that extends PHPlot. All these member variables are subject to change in future releases without concern for backward compatibility.

One exception is the plot tuning variables, which have public visibility. Section 4.7, “Tuning Parameters” describes how these PHPlot member variables can be used to adjust plot appearance. Setting them from your application is generally safe, as they have relatively small effects on plots, and are less likely to change in future releases.

A few additional member class variables have public visibility, due to past use in applications, but you should avoid using them. This includes img, the GD image resource, and fonts, the array of font information.

10.1. List of Member Variables

The table below lists the PHPlot class member variables.

The initial values are listed under Default Value. Variables which are declared but not initialized at the top of the PHPlot class definition have nothing in this column. They can be considered to have an initial value of NULL, which is significant for some variables but not for others.

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.

Variables which hold color values are initialized to defaults using SetDefaultStyles when a PHPlot object is created. For the default colors, see Section 3.5.5, “Plot Element Colors”.

Variable Name:Default Value:Reference Function:Description:
actual_bar_width CalcBarWidthsCalculated width of bars for bar charts
bar_adjust_gap CalcBarWidthsCalculated bar gap
bar_extra_space0.5CalcBarWidthsExtra space between groups of bars (See Tuning Parameters for more)
bar_width_adjust1CalcBarWidthsWidth of bar relative to space for one bar (See Tuning Parameters for more)
bg_color SetBackgroundColorColor (R,G,B,A) for image background
bgimg SetBgImageBackground image filename
bgmode SetBgImageBackground image tiling mode
boxes_frac_width0.3DrawBoxesScale factor for box widths in box plots. Default is 0.3, meaning within min and max limits the boxes will use 30% of the available space for half their width. (See Tuning Parameters for more) (Added in PHPlot-6.1.0)
boxes_max_width8DrawBoxesMaximum half-width for boxes in box plots. Default is 8 pixels. (See Tuning Parameters for more) (Added in PHPlot-6.1.0)
boxes_min_width2DrawBoxesMinimum half-width for boxes in box plots. Default is 2 pixels. (See Tuning Parameters for more) (Added in PHPlot-6.1.0)
boxes_t_width0.6DrawBoxesRatio of the width of the 'T' ends of box plot whiskers to the width of the boxes. Default is 0.6. (See Tuning Parameters for more) (Added in PHPlot-6.1.0)
browser_cacheFALSESetBrowserCacheFlag: Don't send cache suppression headers
bubbles_max_size DrawBubblesMax bubble size for bubbles plots (See Tuning Parameters for more) (Added in PHPlot-5.4.0)
bubbles_min_size6DrawBubblesMin bubbles size for bubble plots (See Tuning Parameters for more) (Added in PHPlot-5.4.0)
callbacksarray(...)SetCallbackCallback (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.
dashed_gridTRUESetDrawDashedGridFlag: Draw dashed or solid grid lines?
dashed_style'2-4'SetDefaultStylesInitial dashed pattern code
data SetDataValuesThe data array
data_border_colors SetDataBorderColorsArray of colors (R,G,B,A) for data borders available with some plot types.
data_colors SetDataColorsArray of colors (R,G,B,A) for data lines/marks/bars/etc. See default_colors for initial value.
data_columns CheckDataArrayMaximum number of dependent variable values (usually Y values, or pie segments) in the data array rows. (Added in PHPlot-5.1.3)
data_max FindDataLimitsArray: Per row maximum Y value. (Before PHPlot-5.1.2 this was named data_maxy.)
data_min FindDataLimitsArray: Per row minimum Y value. (Before PHPlot-5.1.2 this was named data_miny.)
data_type'text-data'SetDataTypeFormat of the data array
data_units_text''FormatLabelObsolete - suffix for 'data'-formatted labels
data_value_label_angle90CheckDataValueLabelsAngle (in degrees) for data value labels (See Tuning Parameters for more)
data_value_label_distance5CheckDataValueLabelsDistance (in pixels) for data value labels (See Tuning Parameters for more)
datalabel_color SetDataLabelColorColor (R,G,B,A) to use for axis data labels (Added in PHPlot-5.7.0)
datatype_error_bars DecodeDataTypeFlag: data type has error bars. (Added in PHPlot-5.1.3)
datatype_implied DecodeDataTypeFlag: data type has implied X or Y. (Added in PHPlot-5.1.3)
datatype_pie_single DecodeDataTypeFlag: data type is one-column, for a pie chart with one segment per row. (Added in PHPlot-5.1.3)
datatype_swapped_xy DecodeDataTypeFlag: data type has swapped X and Y values. (Added in PHPlot-5.1.3)
datatype_yz DecodeDataTypeFlag: data type includes Y and Z value pairs (Added in PHPlot-5.5.0)
datatypesarray(...)DecodeDataType, SetDataTypeStatic array of data type information (Added in PHPlot-6.1.0) (See notes for more)
datatypes_maparray(...)SetDataTypeStatic array of data type aliases (keys) and the corresponding primary name (values) (Added in PHPlot-6.1.0)
decimal_point SetNumberFormatCharacter to use for decimal point in formatted numbers
default_colorsarray(...)SetDataColors, SetErrorBarColorsThe default color array, used to initialize data_colors and error_bar_colors. (Added in PHPlot-5.1.0)
default_dashed_style SetDefaultDashedStyleTemplate string for the dashed line pattern. (In PHPlot-6.1.0 and earlier, this was a PHP code string.)
default_ttfont SetDefaultTTFont, GetDefaultTTFontDefault TrueType font file. (Through PHPlot-5.1.2, there was a static default 'benjamingothic.ttf'. After PHPlot-5.1.2, the default is dynamic.)
donearray()DrawBackground, DrawImageBorder, DrawTitleArray 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_linesFALSESetDrawBrokenLinesFlag: How to handle missing Y values
draw_data_borders SetDrawDataBordersFlag: Draw data borders, available with some plot types (Added in PHPlot-6.0.0)
draw_pie_borders SetDrawPieBordersFlag: Draw borders on pie chart segments (Added in PHPlot-6.0.0)
draw_plot_area_backgroundFALSESetDrawPlotAreaBackgroundFlag: Draw the background of the plot area
draw_x_data_label_linesFALSESetDrawXDataLabelLinesFlag: Draw X data label lines
draw_x_grid SetDrawXGridFlag: Draw X grid lines? (True, False, or NULL meaning the default behavior)
draw_y_data_label_linesFALSESetDrawYDataLabelLinesFlag: Draw Y data label lines (Added in PHPlot-6.0.0)
draw_y_grid SetDrawYGridFlag: Draw Y grid lines? (True, False, or NULL meaning the default behavior)
dvlabel_color SetDataValueLabelColorColor (R,G,B,A) to use for data value labels (Added in PHPlot-5.7.0)
error_bar_colors SetErrorBarColorsArray of colors (R,G,B,A) for error bars. See default_colors for initial value.
error_bar_line_width1SetErrorBarLineWidthThickness of error bar lines
error_bar_shape'tee'SetErrorBarShapeShape (style) of error bars: line or tee
error_bar_size5SetErrorBarSizeSize of error bars
file_format'png'SetFileFormatImage format: png, gif, jpg, wbmp
fonts SetFontGD, SetFontTTFArray of font information. (See notes for more)
grid_at_foregroundFALSEDrawGraphFlag: Draw grid on top of or behind the plot (See Tuning Parameters for more)
grid_color SetGridColorColor (R,G,B,A) to use for axes, plot area border, legend border, pie chart lines and text (not grid!)
group_frac_width0.7CalcBarWidthsControls fraction of bar group space used for bar (See Tuning Parameters for more)
i_border SetImageBorderColorColor (R,G,B,A) for image border, if drawn
image_border_type'none'SetImageBorderTypeImage border type
image_border_width SetImageBorderWidthWidth of image border in pixels. Default depends on image_border_type. (Added in PHPlot-5.1.2)
image_height PHPlotImage height
image_width PHPlotImage width
img PHPlotImage resource
in_error PrintErrorPrevent recursion in error message image production
is_inlineFALSESetIsInlineDon't send headers
label_formatarray(...)SetPieLabelType, SetPrecisionX, SetPrecisionY, SetXDataLabelType, SetXLabelType, SetXTimeFormat, SetYDataLabelType, SetYLabelType, SetYTimeFormatLabel format info. (See notes for more)
label_scale_position0.5SetLabelScalePositionPie chart label position factor
legend SetLegendLegend text array. Each index is a legend text line.
legend_bg_color SetLegendBgColorColor (R,G,B,A) for the legend background (Added in PHPlot-6.0.0)
legend_colorbox_align'right'SetLegendStyleAlignment of color boxes or shape markers in the legend: left, right, or none
legend_colorbox_borders'textcolor'SetLegendColorboxBordersColor control for colorbox borders in legend (Added in PHPlot-6.0.0)
legend_colorbox_width1.0DrawLegendAdjusts width of color boxes in the legend (See Tuning Parameters for more) (Added in PHPlot-5.3.0)
legend_pos SetLegendPositionArray holding legend position information (Added in PHPlot-5.4.0) (See notes for more)
legend_reverse_orderFALSESetLegendReverseFlag: reverse the order of lines in the legend box, bottom to top (Added in PHPlot-5.5.0)
legend_text_align'right'SetLegendStyleLegend style setting, left or right
legend_text_color SetLegendTextColorColor (R,G,B,A) for the legend text (Added in PHPlot-6.0.0)
legend_use_shapesFALSESetLegendUseShapesDraw color boxes (if false or unset) or shape markers (if true) in the legend (Added in PHPlot-5.4.0)
light_grid_color SetLightGridColorColor (R,G,B,A) for grid lines and X data lines
line_spacing4SetLineSpacingControls inter-line spacing of text
line_stylesarray(...)SetLineStylesPlot line style(s)
line_widths1SetLineWidthsPlot line width(s)
locale_overrideFALSEnumber_formatFlag to avoid importing locale info (See Tuning Parameters for more)
max_x FindDataLimitsOverall max X value in the data array
max_y FindDataLimitsOverall max Y value in the data array
max_z FindDataLimitsOverall max Z value in the data array (for X/Y/Z data type only) (Added in PHPlot-5.5.0)
min_x FindDataLimitsOverall min X value in the data array
min_y FindDataLimitsOverall min Y value in the data array
min_z FindDataLimitsOverall min Z value in the data array (for X/Y/Z data type only) (Added in PHPlot-5.5.0)
ndx_bg_color SetColorIndexesColor index of image background
ndx_data_border_colors SetColorIndexesColor index array for data borders
ndx_data_colors SetColorIndexesColor index array for plot data lines/marks/bars/etc.
ndx_data_dark_colors NeedDataDarkColorsColor index array for plot data, darker shade
ndx_datalabel_color SetColorIndexesColor index for axis data labels (Added in PHPlot-5.7.0)
ndx_dvlabel_color SetColorIndexesColor index for data value labels (Added in PHPlot-5.7.0)
ndx_error_bar_colors NeedErrorBarColorsColor index array for error bars
ndx_grid_color SetColorIndexesColor index for axes, plot area border, legend border, pie chart lines and text
ndx_i_border SetColorIndexesColor index for image border lines
ndx_i_border_dark SetColorIndexesColor index for image border lines, darker shade
ndx_legend_bg_color SetColorIndexesColor index for the legend background (Added in PHPlot-6.0.0)
ndx_legend_text_color SetColorIndexesColor index for the legend text (Added in PHPlot-6.0.0)
ndx_light_grid_color SetColorIndexesColor index for grid lines and X data lines
ndx_pieborder_color SetColorIndexesColor index for unshaded pie chart segment borders (Added in PHPlot-6.0.0)
ndx_pielabel_color SetColorIndexesColor index for pie chart data labels (Added in PHPlot-5.7.0)
ndx_plot_bg_color SetColorIndexesColor index of plot area background
ndx_text_color SetColorIndexesColor index for labels and legend text
ndx_tick_color SetColorIndexesColor index for tick marks
ndx_ticklabel_color SetColorIndexesColor index for tick labels (Added in PHPlot-5.7.0)
ndx_title_color SetColorIndexesColor index for main title
ndx_x_title_color SetColorIndexesColor index for X title (Added in PHPlot-5.2.0)
ndx_y_title_color SetColorIndexesColor index for Y title (Added in PHPlot-5.2.0)
num_data_rows SetDataValuesNumber of rows in the data array (number of points along X, or number of bar groups, for example)
num_recs SetDataValuesArray with number of entries in each data row (including label and X if present)
num_x_ticks''SetNumXTicksForced number of X tick marks
num_y_ticks''SetNumYTicksForced number of Y tick marks
ohlc_frac_width0.3DrawOHLCScale 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)
ohlc_max_width8DrawOHLCMaximum 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_min_width2DrawOHLCMinimum 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)
output_file SetOutputFileRedirect to output file
pie_diam_factor0.5DrawPieChartAspect ratio for shaded pie charts. (See Tuning Parameters for more) (Added in PHPlot-5.6.0)
pie_direction_cwFALSESetPieDirectionFlag: If true, pie chart segments are drawn in clockwise direction. If false or unset, they are counter-clockwise. (Added in PHPlot-6.0.0)
pie_full_sizeFALSESetPieAutoSizeFlag: If true, do not include label sizes when calculating pie size. (Added in PHPlot-5.6.0)
pie_label_source SetPieLabelTypeSource of label text for pie charts (percent, value, label, or index) (Added in PHPlot-5.6.0)
pie_min_size_factor0.5DrawPieChartMinimum amount of the plot area that will be reserved for the pie (See Tuning Parameters for more) (Added in PHPlot-5.6.0)
pie_start_angle0SetPieStartAngleStarting angle in degrees for the first segment in a pie chart. (Added in PHPlot-6.0.0)
pieborder_color SetPieBorderColorColor (R,G,B,A) to use for unshaded pie chart segment borders (Added in PHPlot-6.0.0)
pielabel_color SetPieLabelColorColor (R,G,B,A) to use for pie chart data labels (Added in PHPlot-5.7.0)
plot_area CalcPlotAreaPixelsArray defining the calculated plot area. ([0],[1]) is the top left corner, ([2],[3]) is the bottom right corner.
plot_area_height CalcPlotAreaPixelsHeight of the plot area
plot_area_width CalcPlotAreaPixelsWidth of the plot area
plot_bg_color SetPlotBgColorColor (R,G,B,A) for plot area background
plot_border_type SetPlotBorderTypeWhere to draw plot borders. Can be scalar or array of choices.
plot_max_x SetPlotAreaWorld, CalcPlotAreaWorldMax X of the plot area in world coordinates
plot_max_y SetPlotAreaWorld, CalcPlotAreaWorldMax Y of the plot area in world coordinates
plot_min_x SetPlotAreaWorld, CalcPlotAreaWorldMin X of the plot area in world coordinates
plot_min_y SetPlotAreaWorld, CalcPlotAreaWorldMin Y of the plot area in world coordinates
plot_origin_x CalcTranslationX device coordinate of the plot area origin
plot_origin_y CalcTranslationY device coordinate of the plot area origin
plot_type'linepoints'SetPlotTypeSelected plot type
plotbgimg SetPlotAreaBgImagePlot area background image filename
plotbgmode SetPlotAreaBgImagePlot area background image tiling mode
plotsarray(...)DrawGraph, SetPlotType, FindDataLimitsStatic array of plot type information (Added in PHPlot-5.3.0) (See notes for more)
point_counts CheckPointParamsSize of point_shapes and point_sizes arrays (added in PHPlot-5.1.0)
point_shapesarray(...)SetPointShapesMarker shapes for point plots
point_sizesarray(6)SetPointSizesMarker sizes for point plots
print_imageTRUESetPrintImageFlag: Automatic PrintImage after DrawGraph?
rangectlarray(...)TuneXAutoRange, TuneYAutoRange, TuneAutoRangeTuning parameters for plot range calculation (Added in PHPlot-6.0.0) (See notes for more)
record_bar_width CalcBarWidthsArea for each bar in a bar chart
records_per_group SetDataValuesMaximum of num_recs[], max number of entries (including label and X if present) for all data rows
rgb_array SetRGBArrayArray mapping color names to array of R, G, B values
safe_margin5 Fixed extra margin used in multiple places (See Tuning Parameters for more)
saved_version __sleep, __wakeupStores PHPlot version when object was serialized
shading5SetShadingDrop shadow size for pie and bar charts
skip_bottom_tickFALSESetSkipBottomTickSkip bottom tick mark
skip_left_tickFALSESetSkipLeftTickSkip left tick mark
skip_right_tickFALSESetSkipRightTickSkip right tick mark
skip_top_tickFALSESetSkipTopTickSkip top tick mark
stream_boundary StartStreamMIME boundary sequence used with streaming plots (added in PHPlot-5.8.0)
stream_frame_header StartStreamBoundary and MIME header, output before each frame in a plot stream (added in PHPlot-5.8.0)
stream_output_f StartStreamName of the GD output function for this image type, used with streaming plots (added in PHPlot-5.8.0)
suppress_error_imageFALSESetFailureImageFlag: Don't produce an error image on fatal error. Unset is FALSE. (Note the flag value is the negation of the function argument). (Added in PHPlot-5.5.0)
suppress_x_axisFALSESetDrawXAxisFlag: Don't draw the X axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
suppress_y_axisFALSESetDrawYAxisFlag: Don't draw the Y axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
text_color SetTextColorColor (R,G,B,A) for labels and legend text
thousands_sep SetNumberFormatCharacter to use to group 1000s in formatted numbers
tick_color SetTickColorColor (R,G,B,A) for tick marks
tickctlarray(...)TuneXAutoTicks, TuneYAutoTicks, TuneAutoTicksTuning parameters for tick increment calculation (Added in PHPlot-6.0.0) (See notes for more)
ticklabel_color SetTickLabelColorColor (R,G,B,A) to use for tick labels (Added in PHPlot-5.7.0)
title_color SetTitleColorColor (R,G,B,A) for main title (and default for X and Y titles)
title_offset CalcMarginsY offset of main title position (Added in PHPlot-5.1.2)
title_txt''SetTitleMain title text
total_records SetDataValuesTotal number of entries (rows times columns in each row) in the data array.
transparent_color SetTransparentColorColor (R,G,B,A) designated as transparent (Added in PHPlot-5.2.0)
truecolor __sleep, __wakeupFlag: True if serialized object had a truecolor image
ttf_path'.'SetTTFPathTrueType font directory
use_ttfFALSESetUseTTFDefault font type, True for TrueType, False for GD
x_axis_position SetXAxisPositionPosition of X axis (in world coordinates)
x_axis_y_pixels CalcTranslationDevice coordinate for the X axis
x_data_label_angle CheckLabelsEffective X data label text angle (Added in PHPlot-5.1.0)
x_data_label_angle_u''SetXDataLabelAngleX data label text angle (see also x_data_label_angle) (Added in PHPlot-6.0.0)
x_data_label_pos SetXDataLabelPos, CheckLabelsPosition of X data labels. (Default was 'plotdown', but is now applied at graph drawing time.)
x_label_angle0SetXLabelAngleX tick label text angle (and default for x_data_label_angle)
x_label_axis_offset CalcMarginsLabel offset relative to plot area
x_label_bot_offset CalcMarginsLabel offset relative to plot area
x_label_top_offset CalcMarginsLabel offset relative to plot area
x_left_margin CalcMarginsCalculated plot area margin - left side
x_right_margin CalcMarginsCalculated plot area margin - right side
x_tick_anchor SetXTickAnchorX tick anchor point (Added in PHPlot-5.4.0)
x_tick_cross3SetXTickCrossingLength of X tick marks (inside plot area)
x_tick_inc CalcPlotAreaWorldEffective step between X tick marks. This is equal to x_tick_inc_u if SetXTickIncrement was used, else a calculated value.
x_tick_inc_u''SetXTickIncrementStep between X tick marks (see also x_tick_inc) (Added in PHPlot-6.0.0)
x_tick_label_pos SetXTickLabelPosPosition of X tick labels. (Default was 'plotdown', but is now applied at graph drawing time.)
x_tick_length5SetXTickLengthLength of X tick marks (outside plot area)
x_tick_pos'plotdown'SetXTickPosPosition of X tick marks
x_title_bot_offset CalcMarginsTitle offset relative to plot area
x_title_color SetXTitleColorColor (R,G,B,A) for X title (Added in PHPlot-5.2.0)
x_title_pos'none'SetXTitleX Axis title position
x_title_top_offset CalcMarginsTitle offset relative to plot area
x_title_txt''SetXTitleX Axis title text
xscale CalcTranslationX scale factor for converting World to Device coordinates
xscale_type'linear'SetXScaleTypeLinear or log scale on X
y_axis_position SetYAxisPositionPosition of Y axis (in world coordinates)
y_axis_x_pixels CalcTranslationDevice coordinate for the Y axis
y_bot_margin CalcMarginsCalculated plot area margin - bottom
y_data_label_angle0SetYDataLabelAngleY data label text angle (Added in PHPlot-5.1.0)
y_data_label_pos SetYDataLabelPos, CheckLabelsPosition of Y data labels
y_label_angle0SetYLabelAngleY tick label text angle
y_label_axis_offset CalcMarginsLabel offset relative to plot area
y_label_left_offset CalcMarginsLabel offset relative to plot area
y_label_right_offset CalcMarginsLabel offset relative to plot area
y_tick_anchor SetYTickAnchorY tick anchor point (Added in PHPlot-5.4.0)
y_tick_cross3SetYTickCrossingLength of Y tick marks (inside plot area)
y_tick_inc CalcPlotAreaWorldEffective step between Y tick marks. This is equal to y_tick_inc_u if SetYTickIncrement was used, else a calculated value.
y_tick_inc_u''SetYTickIncrementStep between Y tick marks (see also y_tick_inc) (Added in PHPlot-6.0.0)
y_tick_label_pos SetYTickLabelPos, CheckLabelsPosition of Y tick labels
y_tick_length5SetYTickLengthLength of Y tick marks (outside plot area)
y_tick_pos'plotleft'SetYTickPosPosition of Y tick marks
y_title_color SetYTitleColorColor (R,G,B,A) for Y title (Added in PHPlot-5.2.0)
y_title_left_offset CalcMarginsTitle offset relative to plot area
y_title_pos'none'SetYTitleY Axis title position
y_title_right_offset CalcMarginsTitle offset relative to plot area
y_title_txt''SetYTitleY Axis title text
y_top_margin CalcMarginsCalculated plot area margin - top
yscale CalcTranslationY scale factor for converting World to Device coordinates
yscale_type'linear'SetYScaleTypeLinear or log scale on Y

SourceForge.net Logo

This version of the manual was produced for the PHPlot Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the PHPlot project downloads area.