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.6, “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 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'white'SetBackgroundColorColor (R,G,B,A) for image background
bgimg SetBgImageBackground image filename
bgmode SetBgImageBackground image tiling mode
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_size DrawBubblesMin 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.
color_array'small'PHPlotName of the initial color map
dashed_gridTRUESetDrawDashedGridFlag: Draw dashed or solid grid lines?
dashed_style'2-4'SetDefaultStylesInitial dashed pattern code
data SetDataValuesThe data array
data_border_colors'black'SetDataBorderColorsArray of colors (R,G,B,A) for bar chart data borders.
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_angle CheckDataValueLabelsAngle (in degrees) for data value labels (See Tuning Parameters for more)
data_value_label_distance CheckDataValueLabelsDistance (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 data for pie chart with one segments 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)
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 SetDefaultDashedStyleFormatted PHP code to build a dashed line pattern
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.)
done 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_plot_area_backgroundFALSESetDrawPlotAreaBackgroundFlag: Draw the background of the plot area
draw_x_data_label_linesFALSESetDrawXDataLabelLinesFlag: Draw X data label lines
draw_x_grid SetDrawXGrid, CalcGridSettingsFlag: Draw X grid lines?
draw_y_grid SetDrawYGrid, CalcGridSettingsFlag: Draw Y grid lines?
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'black'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_borderarray(194, 194 ,194)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 sent 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_colorbox_align SetLegendStyleAlignment of color boxes or point shapes in the legend: left, right, or none
legend_colorbox_width DrawLegendAdjusts 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_order SetLegendReverseFlag: reverse the order of lines in the legend box, bottom to top (Added in PHPlot-5.5.0)
legend_text_align SetLegendStyleLegend style setting, left or right
legend_use_shapes SetLegendUseShapesDraw color boxes (if false or unset) or point shapes (if true) in the legend (Added in PHPlot-5.4.0)
light_grid_color'gray'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_override number_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 bar chart 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_light_grid_color SetColorIndexesColor index for grid lines and X data lines
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_width DrawOHLCScale 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_width DrawOHLCMaximum 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_width DrawOHLCMinimum 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_factor DrawPieChartAspect ratio for shaded pie charts. (See Tuning Parameters for more) (Added in PHPlot-5.6.0)
pie_full_size SetPieAutoSizeFlag: If true, do not include label sizes when calculating pie size. (Added in PHPlot-5.6.0)
pie_min_size_factor DrawPieChartMinimum amount of the plot area that will be reserved for the pie (See Tuning Parameters for more) (Added in PHPlot-5.6.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'white'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(...)SetPointSizesMarker sizes for point plots
print_imageTRUESetPrintImageFlag: Automatic PrintImage after DrawGraph?
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)
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_image SetFailureImageFlag: 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_axis SetDrawXAxisFlag: Don't draw the X axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
suppress_y_axis SetDrawYAxisFlag: Don't draw the Y axis line. Unset (by default) means FALSE. (Added in PHPlot-5.3.0)
text_color'black'SetTextColorColor (R,G,B,A) for labels and legend text
thousands_sep SetNumberFormatCharacter to use to group 1000s in formatted numbers
tick_color'black'SetTickColorColor (R,G,B,A) for tick marks
ticklabel_color SetTickLabelColorColor (R,G,B,A) to use for tick labels (Added in PHPlot-5.7.0)
title_color'black'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)
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 SetXDataLabelAngleX data label text angle (Added in PHPlot-5.1.0)
x_data_label_pos SetXDataLabelPosPosition 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''SetXTickIncrementStep between X tick marks
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'plotdown'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 labels above bars
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''SetYTickIncrementStep between Y tick marks
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'plotleft'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