]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/external_packages/phplot/doc/internal_functions.html
commit changes
[bacula/bacula] / gui / bacula-web / external_packages / phplot / doc / internal_functions.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML><HEAD>
3 <TITLE>PHPlot Internal Functions</TITLE>
4 </HEAD>
5 <BODY>
6
7 <h2>PHPlot Internal Functions</h2>
8
9 <p><DT><B>DrawArea()</B>
10 <DD>Internal Function: Draw an Area Chart. $data[] must already be defined as data-data
11 using $data[] = array("title",x,y1,y2,...) Points are placed at (x,y1), (x,y2), ...
12 one x-point per $data[] element. <BR>Colors and border colors for each of the y1, y2, ... is set
13 by <B>SetDataColors($which_data,$which_border)</B>
14 This function is called if
15 you use SetPlotType("area") and SetDataType("data-data")
16
17
18 <p><DT><B>DrawAreaSeries()</B>
19 <DD>Internal Function: Draw an Area Chart. $data[] must already be defined as $data[] =
20 array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per
21 $data[] element. <BR>Colors and border colors for each of the y1, y2, ... is set
22 by <B>SetDataColors($which_data,$which_border)</B>
23 This function is called if
24 you use SetPlotType("area") and SetDataType("text-data")
25
26 <p><DT><B>DrawBackground()</B>
27 <DD>Internal Function: Draw the full background of the image on image pointer. Should be used
28 BEFORE other Draw functions unless you really want to overwrite what you've done
29 before. See <B>SetBackgroundColor</B> and <B>SetImageArea</B> for setting
30 parameters.
31
32 <p><DT><B>DrawBars()</B>
33 <DD>Internal Function: Draw vertical bars. $data[] must already be defined as $data[] =
34 array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per
35 $data[] element. <BR>Colors and border colors for each of the y1, y2, ... is set
36 by <B>SetDataColors($which_data,$which_border)</B>
37 This function is called if
38 you use SetPlotType("bars") and SetDataType("text-data")
39
40 <p><DT><B>DrawDashedLine($x1,$y1,$x2,$y2,$dashed, $space, $color)</B>
41 <DD>Internal Function: Called instead of ImageLine when line_style = 'dashed'
42 line_style is set by <b>SetLineStyles</b> All variables passed to DrawDashedLine
43 are in pixel coordinates.
44
45 <p><DT><B>DrawDots()</B>
46 <DD>Internal Function: Draw Dots as defined by <B>SetPointType</B> and data in x,y format. $data[]
47 must already be defined as $data[] = array("title",x,y1,y2,...) Where the point
48 occurs depends on both the X and Y values. <BR>Colors and border colors for each
49 y1, y2, , ... is set by <B>SetDataColors($which_data,$which_border)</B>
50 This function is called if
51 you use SetPlotType("dots") and SetDataType("data-data")
52
53 <p><DT><B>DrawDotSeries()</B>
54 <DD>Internal Function: Draw Dots as defined by <B>SetPointType</B> and data in text-data format.
55 $data[] must already be defined as $data[] = array("title",y1,y2,...)
56 The x axis is divided evenly, one x-point per $data[] element. <BR>
57 Colors and border colors
58 for each y1, y2, , ... is set by <B>SetDataColors($which_data,$which_border)</B>
59 This function is called if
60 you use SetPlotType("dots") and SetDataType("text-data")
61
62 <p><DT><B>DrawDotsError()</B>
63 <DD>Internal Function: Draw Dots and Error Bars as defined by <B>SetPointType</B> and
64 data in data-data-error format. $data[] must already be defined
65 as $data[] = array("label",x,y,error+,error-)
66 Colors and border colors
67 for each y1, y2, , ... is set by <B>SetDataColors($which_data,$which_border)</B>
68 The shape of the error bars is defined by <B>SetErrorBarShape($which_ebs)</B>
69 and <B>SetErrorBarSize($which_ebs)</B> <br>
70 This function is called if
71 you use SetPlotType("dots") and SetDataType("data-data-error")
72
73 <p><DT><B>DrawError($error_message)</B>
74 <DD>Internal Function: Draw an internal error message printed on the Image directly.
75 This way - if there is an error and the output is an image you
76 don't get the PHP "Header already sent" messages.
77
78 <p><DT><B>DrawGraph()</B>
79 <DD>Internal Function: This is th last function called after you have set up
80 all the parameters of the graph see <b>Set....</b> functions below.
81
82 <p><DT><B>DrawHorizontalTicks()</B>
83 <DD>Internal Function:  Draw the ticks on the X axis.
84 The distance between ticks can be defined in a number of ways. <i>Note:
85 that for text-data data its best to let the program handle the
86 distance between ticks - the default is  1.</i>  (Text-data data is data where the data is evenly spaced over
87 the x axis, no x-value is entered)
88
89 <p><DT><B>DrawImageBorder()</B>
90 <DD>Internal Function: Draw the border around the entire image. Currently this
91 generates the raised border look around the image.
92
93 <p><DT><B>DrawLabels()</B>
94 <DD>Internal Function: Draw the Title, X-axis label, and the Y-axis label. This
95 really just calls DrawTitle, DrawXLabel, and DrawYLabel.
96
97 <p><DT><B>DrawLegend(x,y,type)</B>
98 <DD>Internal Function: Draw the Legend. See <b>SetLegendPixels()</b>
99
100 <p><DT><B>DrawLines()</B>
101 <DD>Internal Function: Draw lines in data-data format.
102 $data[] must already be defined
103 as $data[] = array("label",x,y1,y2,....)
104 Colors and border colors
105 for each y1, y2, , ... is set by <B>SetDataColors($which_data,$which_border)</B>
106 This function is called if
107 you use SetPlotType("lines") and SetDataType("data-data")
108 <br>
109
110 <p><DT><B>DrawLineSeries()</B>
111 <DD>Internal Function: Draw lines in text-data format.
112 $data[] must already be defined
113 as $data[] = array("label",y1,y2,y3,....)
114 The x axis is divided evenly, one x-point per
115 $data[] element. <BR>Colors and border colors for each of the y1, y2, ... is set
116 by <B>SetDataColors($which_data,$which_border)</B>
117 This function is called if
118 you use SetPlotType("lines") and SetDataType("text-data")
119
120 <p><DT><B>DrawLinesError()</B>
121 <DD>Internal Function: Lines and Error Bars as defined by <B>SetPointType</B> and
122 data in data-data-error format. $data[] must already be defined
123 as $data[] = array("label",x,y,error+,error-)
124 Colors and border colors
125 for each y1, y2, , ... is set by <B>SetDataColors($which_data,$which_border)</B>
126 The shape of the error bars is defined by <B>SetErrorBarShape($which_ebs)</B>
127 and <B>SetErrorBarSize($which_ebs)</B>
128 This function is called if
129 you use SetPlotType("lines") and SetDataType("data-data-error")
130
131 <p><DT><B>DrawPieChart()</B>
132 <DD>Internal Function: Draw pie chart. Data is in text-data format. $data[] must
133 already been defined as $data[] = array("label",y1,y2,y3,...)<BR>
134 Colors and border colors for each of the y1, y2, ... is set
135 by <B>SetDataColors($which_data,$which_border)</B>
136 This function is called if
137 you use SetPlotType("pie") and SetDataType("text-data")
138
139 <p><DT><B>DrawPlotAreaBackground()</B>
140 <DD>Internal Function: Draw the Background - in the color as defined by <b>X</b>
141 and in an area as defined by <b>X</b>
142
143 <p><DT><B>DrawPlotBorder()</B>
144 <DD>Internal Function: Draw the border around the
145 plot area - (Note: this is NOT the full image).  This draws
146 the rectangle as well as calling the functions
147 <b>DrawVerticalTicks()</b> and <b>DrawXAxis()</b>
148
149 <p><DT><B>DrawTitle()</B>
150 <DD>Internal Function: This will draw the title as set by
151 <b>SetTitle</b> and
152 <b>SetTitleColor</b>. This is also affected by SetUseTTF
153 to show how the title appears.
154
155
156 <p><DT><B>DrawVerticalTicks()</B>
157 <DD>Internal Function: Called by DrawPlotBorder. The spacing between the ticks
158 is automatically set unless you have previously set the increment
159 by
160         <B>SetNumVertTicks($which_nt)</B>
161 or
162         <b>SetVertTickIncrements</b> but not both.
163
164 <p><DT><B>DrawXAxis()</B>
165 <DD>Internal Function: Draw the horizontal X axis at the world position X=0.
166
167 <p><DT><B>DrawXLabel()</B>
168 <DD>Internal Function: Called from DrawLabels. Draws the label of the X-Axis.
169
170 <p><DT><B>DrawYErrorBar($x_world,$y_world,$error_height,$error_bar_type,$color)</B>
171 <DD>Internal Function: This is similar to DrawDot, but it draws error bars.
172 Draw one set of error bars at $x_world and $y_world where the
173 data is defined in world coordinates (not pixel coordinates).
174
175 <p><DT><B>DrawYLabel()</B>
176 <DD>Internal Function: Called from DrawLabels. Draws the label of the Y-Axis. Its
177 position is defined by the size of the font. Typically there is a
178 two character height width around the plot area for drawing the
179 labels.
180
181 <p><DT><B>FindDataLimits()</B>
182 <DD>Internal Function: This must be called AFTER SetDataType.  It finds
183 the maxima and minima for setting the scaling to be
184 able to convert from world to pixel coordinates.
185
186 <p><DT><B>InitImage()</B>
187 <DD>Internal Function: An internal function called to set the
188 image pointer for GD.
189
190 <p><DT><B>PrintError($error_message)</B>
191 <DD>Internal Function: Prints the given error message to stdout. The function
192 is used for fatal errors that do not allow for creating an image.
193
194 <p><DT><B>PrintImage()</B>
195 <DD>Internal Function: An internal function which prints the image using the PHP
196 functions Header("Content-type:...") and ImageGIF(), ImageJPEG(),
197 or ImagePNG() depending on what the setting is of $this->file_format.
198 This is set by <b>SetFileFormat()</b>
199
200 <p><DT><B>SetColor($color_asked)</B>
201 <DD>Internal Function:  Translate from $color_asked to the index
202 name color used in GD.
203 $color_asked can be either a name like "black" or an rgb color array
204 array(int,int,int). <br>
205
206 <p><DT><B>SetDefaultColors()</B>
207 <DD>Internal Function: Sets the default colors when first defining an image.
208 Overridden by functions like <b>SetPlotBgColor</b>,
209         <b>SetBackgroundColor</b>,
210         <b>SetTextColor</b>,
211         <b>SetGridColor</b>,
212         <b>SetLightGridColor</b>,
213         <b>SetTickColor</b>, and
214         <b>SetTitleColor</b>
215
216 <p><DT><B>SetDrawYGrid($which_dyg)</B>
217 <DD>Internal Function: 1 = Draw the Y grid. Anything else, don't draw the Y grid.
218
219 <p><DT><B>SetEqualXCoord()</B>
220 <DD>Internal Function: For text-data graphs set the spacing between
221 data points on the x-axis.
222
223 <p><DT><B>SetMargins()</B>
224 <DD>Internal Function: When the image is first created - set the margins
225     as the full area of the view surface (or panel),
226     less a margin of 4 character heights all round for labelling.
227     It thus depends on the current character size, set by SetCharacterHeight().
228
229 <p><DT><B>SetTranslation()</B>
230 <DD>Internal Function: Calculate the scale and origin for translating from
231 world to pixel coordinates. This is an internal function,
232 not one that you'd use normally, but if you are going to
233 use it make sure you do it after SetDataType.
234
235 <p><DT><B>SetXLabelHeight()</B>
236 <DD>Internal Function: This is an internal function that sets the
237 height of the X labels based on the maximum string
238 length of the X data. It is used for positioning
239 where the labels go relative to the x-axis.
240
241
242 <p><DT><B>SetYLabelWidth()</B>
243 <DD>Internal Function: Set the
244 width of the Y Label based on the maximum string
245 length of the Y data. It is used for positioning
246 where the labels go relative to the y-axis.
247
248
249 <p><DT><B>TTFBBoxSize($size, $angle, $font, $string)</B>
250 <DD>Internal Function: Calculate the size of the box which encloses the
251 text string <b>$string</b> using font <b>$font</b>,
252 angle <b>$angle</b> and size <b>$size</b>. This is
253 an internal function which is not called unless use_ttf is
254 set to 1.
255
256 <p><DT><B>xtr($x_world)</B>
257 <DD>Internal Function: Translate into x-pixels coordinates from x world coordinates.
258
259 <p><DT><B>ytr($y_world)</B>
260 <DD>Internal Function: Translate into y-pixels coordinates from y world coordinates.
261
262
263
264
265
266 </dl>
267
268 </body>
269 </html>