## PHPlot Internal Functions

DrawArea()
  Internal Function: Draw an Area Chart. $data[] must already be defined as data-data using $data[] = array("title",x,y1,y2,...) Points are placed at (x,y1), (x,y2), ... one x-point per $data[] element.
  Colors and border colors for each of the y1, y2, ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("area") and SetDataType("data-data")

DrawAreaSeries()
  Internal Function: Draw an Area Chart. $data[] must already be defined as $data[] = array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per $data[] element.
  Colors and border colors for each of the y1, y2, ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("area") and SetDataType("text-data")

DrawBackground()
  Internal Function: Draw the full background of the image on image pointer. Should be used BEFORE other Draw functions unless you really want to overwrite what you've done before. See SetBackgroundColor and SetImageArea for setting parameters.

DrawBars()
  Internal Function: Draw vertical bars. $data[] must already be defined as $data[] = array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per $data[] element.
  Colors and border colors for each of the y1, y2, ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("bars") and SetDataType("text-data")

DrawDashedLine($x1,$y1,$x2,$y2,$dashed, $space, $color)
  Internal Function: Called instead of ImageLine when line_style = 'dashed' line_style is set by SetLineStyles All variables passed to DrawDashedLine are in pixel coordinates.

DrawDots()
  Internal Function: Draw Dots as defined by SetPointType and data in x,y format. $data[] must already be defined as $data[] = array("title",x,y1,y2,...) Where the point occurs depends on both the X and Y values.
  Colors and border colors for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("dots") and SetDataType("data-data")

DrawDotSeries()
  Internal Function: Draw Dots as defined by SetPointType and data in text-data format. $data[] must already be defined as $data[] = array("title",y1,y2,...) The x axis is divided evenly, one x-point per $data[] element.
  Colors and border colors for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("dots") and SetDataType("text-data")

DrawDotsError()
  Internal Function: Draw Dots and Error Bars as defined by SetPointType and data in data-data-error format. $data[] must already be defined as $data[] = array("label",x,y,error+,error-) Colors and border colors for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) The shape of the error bars is defined by SetErrorBarShape($which_ebs) and SetErrorBarSize($which_ebs)
  This function is called if you use SetPlotType("dots") and SetDataType("data-data-error")

DrawError($error_message)
  Internal Function: Draw an internal error message printed on the Image directly. This way - if there is an error and the output is an image you don't get the PHP "Header already sent" messages.

DrawGraph()
  Internal Function: This is th last function called after you have set up all the parameters of the graph see Set.... functions below.

DrawHorizontalTicks()
  Internal Function: Draw the ticks on the X axis. The distance between ticks can be defined in a number of ways. Note: that for text-data data its best to let the program handle the distance between ticks - the default is 1. (Text-data data is data where the data is evenly spaced over the x axis, no x-value is entered)

DrawImageBorder()
  Internal Function: Draw the border around the entire image. Currently this generates the raised border look around the image.

DrawLabels()
  Internal Function: Draw the Title, X-axis label, and the Y-axis label. This really just calls DrawTitle, DrawXLabel, and DrawYLabel.

DrawLegend(x,y,type)
  Internal Function: Draw the Legend. See SetLegendPixels()

DrawLines()
  Internal Function: Draw lines in data-data format. $data[] must already be defined as $data[] = array("label",x,y1,y2,....) Colors and border colors for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("lines") and SetDataType("data-data")

DrawLineSeries()
  Internal Function: Draw lines in text-data format. $data[] must already be defined as $data[] = array("label",y1,y2,y3,....) The x axis is divided evenly, one x-point per $data[] element.
  Colors and border colors for each of the y1, y2, ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("lines") and SetDataType("text-data")

DrawLinesError()
  Internal Function: Lines and Error Bars as defined by SetPointType and data in data-data-error format. $data[] must already be defined as $data[] = array("label",x,y,error+,error-) Colors and border colors for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) The shape of the error bars is defined by SetErrorBarShape($which_ebs) and SetErrorBarSize($which_ebs) This function is called if you use SetPlotType("lines") and SetDataType("data-data-error")

DrawPieChart()
  Internal Function: Draw pie chart. Data is in text-data format. $data[] must already been defined as $data[] = array("label",y1,y2,y3,...)
  Colors and border colors for each of the y1, y2, ... is set by SetDataColors($which_data,$which_border) This function is called if you use SetPlotType("pie") and SetDataType("text-data")

DrawPlotAreaBackground()
  Internal Function: Draw the Background - in the color as defined by X and in an area as defined by X

DrawPlotBorder()
  Internal Function: Draw the border around the plot area - (Note: this is NOT the full image). This draws the rectangle as well as calling the functions DrawVerticalTicks() and DrawXAxis()

DrawTitle()
  Internal Function: This will draw the title as set by SetTitle and SetTitleColor. This is also affected by SetUseTTF to show how the title appears.

DrawVerticalTicks()
  Internal Function: Called by DrawPlotBorder. The spacing between the ticks is automatically set unless you have previously set the increment by SetNumVertTicks($which_nt) or SetVertTickIncrements but not both.

DrawXAxis()
  Internal Function: Draw the horizontal X axis at the world position X=0.

DrawXLabel()
  Internal Function: Called from DrawLabels. Draws the label of the X-Axis.

DrawYErrorBar($x_world,$y_world,$error_height,$error_bar_type,$color)
  Internal Function: This is similar to DrawDot, but it draws error bars. Draw one set of error bars at $x_world and $y_world where the data is defined in world coordinates (not pixel coordinates).

DrawYLabel()
  Internal Function: Called from DrawLabels. Draws the label of the Y-Axis. Its position is defined by the size of the font. Typically there is a two character height width around the plot area for drawing the labels.

FindDataLimits()
  Internal Function: This must be called AFTER SetDataType. It finds the maxima and minima for setting the scaling to be able to convert from world to pixel coordinates.

InitImage()
  Internal Function: An internal function called to set the image pointer for GD.

PrintError($error_message)
  Internal Function: Prints the given error message to stdout. The function is used for fatal errors that do not allow for creating an image.

PrintImage()
  Internal Function: An internal function which prints the image using the PHP functions Header("Content-type:...") and ImageGIF(), ImageJPEG(), or ImagePNG() depending on what the setting is of $this->file_format. This is set by SetFileFormat()

SetColor($color_asked)
  Internal Function: Translate from $color_asked to the index name color used in GD. $color_asked can be either a name like "black" or an rgb color array array(int,int,int).

SetDefaultColors()
  Internal Function: Sets the default colors when first defining an image. Overridden by functions like SetPlotBgColor, SetBackgroundColor, SetTextColor, SetGridColor, SetLightGridColor, SetTickColor, and SetTitleColor

SetDrawYGrid($which_dyg)
  Internal Function: 1 = Draw the Y grid. Anything else, don't draw the Y grid.

SetEqualXCoord()
  Internal Function: For text-data graphs set the spacing between data points on the x-axis.

SetMargins()
  Internal Function: When the image is first created - set the margins as the full area of the view surface (or panel), less a margin of 4 character heights all round for labelling. It thus depends on the current character size, set by SetCharacterHeight().

SetTranslation()
  Internal Function: Calculate the scale and origin for translating from world to pixel coordinates. This is an internal function, not one that you'd use normally, but if you are going to use it make sure you do it after SetDataType.

SetXLabelHeight()
  Internal Function: This is an internal function that sets the height of the X labels based on the maximum string length of the X data. It is used for positioning where the labels go relative to the x-axis.

SetYLabelWidth()
  Internal Function: Set the width of the Y Label based on the maximum string length of the Y data. It is used for positioning where the labels go relative to the y-axis.

TTFBBoxSize($size, $angle, $font, $string)
  Internal Function: Calculate the size of the box which encloses the text string $string using font $font, angle $angle and size $size. This is an internal function which is not called unless use_ttf is set to 1.

xtr($x_world)
  Internal Function: Translate into x-pixels coordinates from x world coordinates.

ytr($y_world)
  Internal Function: Translate into y-pixels coordinates from y world coordinates.