9.3. Available Callbacks

This section defines the currently available callback names. A callback name is also called a reason.

Most of the callbacks currently available are drawing callbacks, activated during the graph drawing process started by DrawGraph. By convention, a drawing callback occurs right after the event which it names. For example, the draw_titles callback will be called after drawing the plot titles.

Debug callbacks are for use when developing and debugging PHPlot itself. Needless to say, their use for other purposes is discouraged.

The following table lists the available callback reasons.

Reason Name:Calling Point:Extra Parameters:Notes:
draw_setupAfter all setup, before drawing anything.(None)Anything drawn here will be covered by the background.
draw_image_backgroundAfter drawing the image backgrounds and border.(None) 
draw_plotarea_backgroundAfter drawing the plot area background.(None) 
draw_titlesAfter drawing the plot title, X and Y titles.(None)Called even if no titles were set.
draw_axesAfter drawing the X and Y axis and grid lines.(None)Not called for pie charts.
draw_graphAfter drawing the body of the graph.(None) 
draw_borderAfter drawing the plot area border.(None)Not called for pie charts.
draw_legendAfter drawing the legend, if legend is enabled.(None)Not called if no legend was set.
debug_textboxJust before drawing any text.$px, $py, $bbox_width, $bbox_heightProvides access to the orthogonal bounding box position and size for the text string.
debug_scaleCalled at end of many scale calculation functions.Function name, then an array of variable name => valueFor displaying intermediate values in margin and scale calculations.