root/trunk/flowmon-web/charts/phplot-5.0.5/ChangeLog

Revision 1, 25.4 kB (checked in by ixs, 16 years ago)

initial checkin of RH revision

Line 
1 This is the Change Log for PHPlot.
2 The project home page is http://sourceforge.net/projects/phplot/
3 -----------------------------------------------------------------------------
4
5 2008-01-13 (lbayuk)     ===== Released as 5.0.5 =====
6     * phplot.php: Updated version
7     * README.txt: Updated for new release
8     * NEWS.txt: Add text for new release
9     * Makefile: Remove 'Callbacks' from release target, as this material is
10       now in the reference manual.
11
12 2008-01-07 (lbayuk)
13     Copyright updated to 2008 and PHP4 no longer listed as supported.
14
15     Major rewrite of the margin calculation functions to address multiple
16     problems.  Fixes for bugs 1856207 "Margin error with 'xaxis'/'yaxis'
17     position, 1843012 "Make margins, drawing consistent", and 945439
18     "x_tick_label_height not set correctly".
19
20     Note: These changes are inter-dependent and cannot be split up.
21
22     * Defer all calculations to DrawGraph time, to eliminate order dependencies.
23       These functions now just store their arguments in the object, and all
24       calculations happen later:
25     + SetXAxisPosition, SetYAxisPosition
26     + SetMarginsPixels
27     + SetPlotAreaPixels (Stores margins, not area, now.)
28     + SetPlotAreaWorld
29     + SetXTickIncrement, SetYTickIncrement
30
31     * A new callback 'debug_scale' was added to trace the margin and scale
32       calculations.
33
34     * CalcMargins was rewritten. Actual sizes of tick and data labels are now
35       used, rather than guesses like "use size of biggest Y value". A minimum
36       value (3 x safe_margin, or 15 pixels) applies to each margin.
37
38     * FindDataLimits no longer needs to find the longest data label, since
39       CalcMargins now does that more precisely.
40
41     * DrawXTitle and DrawYTitle now use position offsets calculated by
42       CalcMargins. Note: These titles are now offset from the plot area,
43       not the image area. The titles will move if you had set the plot area
44       or margins.
45
46     * DrawYTick, DrawXTick rewritten to use pre-calculated offsets, and common
47       code moved to new CalcTicks().
48
49     * DrawXDataLabel: Use pre-calculated offsets for text.
50
51     * DrawGraph: Rewrote top section (before drawing anything) to do the
52       calculations in the proper order, unconditionally.
53
54     * Class variables removed:
55       x_label_inc, y_label_inc, _x_label_cnt : These were never used.
56       title_height, x_title_height, y_title_width : Now internal to CalcMargins.
57       data_limits_done : No more need to remember if FindDataLimits called.
58
59     * New class variables added:
60       plot_margins_set : Keeps track of user-set plot area or automatic.
61       x_label_top_offset, x_label_bot_offset, x_offset_axis_offset,
62           y_label_left_offset, y_label_right_offset, y_label_axis_offset,
63           x_title_top_offset, x_title_bot_offset,
64           y_title_left_offset, y_title_left_offset : Label offsets
65      
66     * New internal functions:
67       CalcPlotAreaPixels : Deferred calculations taken out of SetPlotAreaPixels
68         and SetMarginsPixels.
69       CalcPlotAreaWorld : Deferred calculations taken out of SetPlotAreaWorld.
70       CalcAxisPositions : Calculate axis positions, moved from CalcTranslation.
71       CalcTicks : Calculate X and Y tick interval. This still uses the
72         same simple method (basically range/10), but now we could drop in a new
73         algorithm much more easily. This is now also used by CalcMargins.
74         Code taken out of DrawXTicks and DrawYTicks.
75       CalcMaxTickLabelSize : So CalcMargins can use the exact tick label sizes.
76       CalcMaxDataLabelSize : So CalcMargins can use the exact data label sizes.
77       DrawXTick : Code split out from DrawXTicks for symmetry with DrawYTick.
78
79
80 2007-12-13 (lbayuk)
81     * Changed ProcessTextTTF() so SizeText() will return integers. It rounds
82       the calculated values up, so the bounding box really contains the text.
83       This also prevents unneeded float calculations in derived values.
84
85 2007-12-09 (lbayuk)
86     Major rewrite of the text drawing functions to address multiple problems.
87     Note: These changes are inter-dependent and cannot be split up.
88
89     * Fixed bug 1813070 "Bad position for multi-line TrueType text":
90       TTF text is now drawn line-by-line, not as a block, for proper
91       alignment and positioning.
92
93     * Fixed bug 1813071 "Wrong title height for multi-line TTF text":
94       Corrected miscalculation of overall height of multi-line TTF titles.
95       This bug resulted in over-sized margins.
96       The height is now computed line-by-line, including the inter-line spacing.
97
98     * Fixed bug 1813474 "DrawText alignment arguments wrong":
99       Corrected meaning of 'top' vs 'bottom' alignment. PHPlot now follows
100       the usual conventions: 'top' alignment means top of text to reference.
101       DrawText default for vertical alignment is still 'bottom', but the
102       meaning was corrected.  All callers of DrawText were fixed.
103
104     * Fixed bug 1816844 "Fix order dependency for setting titles":
105       Defer processing titles strings until DrawGraph(), so there is no
106       more order dependency (no need to set font before setting title strings).
107
108     * Fixed bug 1819668 "Horiz. align multi-line text: GD vs TTF":
109       The new text routines draw TTF text line-by-line and correctly do
110       right-, center-, and left- alignment of each line within a text block.
111
112     * Fixed bug 1826513 "FIXME in DrawLegend: Max label length":
113       Use actual width of widest legend line to calculate legend box size.
114
115     * Partial fix for bug 945439 "x_tick_label_height not set correctly":
116       In FindDataLimits(), save the longest data label, not just its length,
117       and use the actual rendered size of that string in CalcMargins() for
118       the margin calculations.
119       Also take into account which of the tick or data labels are visible.
120       This is not a complete fix, but is a significant improvement.
121
122     The following changes were made related to the above fixes:
123
124     + Replaced internal function TTFBBoxSize(), which didn't work right, with
125       SizeText(). It returns the orthogonal bounding box of a block of text,
126       and works with both GD and TTF text.
127
128     + DrawText() and SizeText() call a single function ProcessText(), which is
129       the only place GD text and TTF text are distinguished. (So eventually
130       we will be able to mix GD and TTF text on a plot.)
131
132     + New internal functions ProcessTextGD() and ProcessTextTTF() draw (or size)
133       GD and TTF text respectively. These are only called by ProcessText().
134       These are re-implementations which properly position and align text.
135
136     + Removed class variables title_angle, x_title_angle, and y_title_angle. The
137       titles only work at their fixed angles anyway (0, 0, and 90 respectively).
138
139     + Line spacing set with SetLineSpacing() now affects TTF text as well as
140       GD text. Previously, it only affected GD text. The default line spacing
141       happens to be usable for TTF text.
142
143     + Added new callback hook 'debug_textbox' for developing, testing, and
144       documenting. It provides access to the text area bounding box.
145
146     + Removed unneeded class variables x_tick_label_height, y_tick_label_width,
147       x_tot_margin, y_tot_margin.
148
149 2007-11-25
150     * Improve error handling:
151       Internal functions PrintError() and DrawError() are now the same. Both
152       will draw the error message into the image and output it, and then
153       trigger a user-level error. If no error handler has been set, it will
154       exit, as before. But now the error message should also get logged, or
155       written to the standard error stream, depending on the SAPI in use.
156       You can now establish an error handler to catch most PHPlot errors and
157       do some cleanup before exit.
158
159       This fix also covers bug #1823774 "Default Font Path and Error Message
160       Output".
161
162       Fixed the return value of most PHPlot functions, to return False on
163       error, else True. Since uncaught errors are fatal anyway, this only
164       affects code with an error handler that returns, which is not
165       recommended and unsupported at this time. These changes are for
166       possible future error handling options.
167
168 2007-11-22
169     * Fix bug 1836528 "Insufficient checking of parameter values":
170       Rewrote CheckOption to correctly validate option choices.
171       (It previously accepted substrings and other incorrect values.)
172       PHPlot methods that use CheckOption now must be called with valid option
173       values. Empty strings are also no longer accepted.
174
175 2007-11-17 (lbayuk)
176     * Change to callbacks to support extra arguments.
177       The PHPlot class can now pass extra arguments to a callback function.
178       Callback functions now take the following form:
179           my_callback($img, $passthru_arg, ...)
180       Where '...' is zero or more additional arguments supplied by PHPlot to
181       the callback. Each implemented callback reason will define any
182       additional arguments it uses. The existing defined callbacks have not
183       changed and do not currently pass any extra arguments.
184
185 2007-11-10 (lbayuk)
186     * Fix bug 1827263 "Spoiled up pie-chart if $val is close to zero":
187       Skip pie slices which would result in an integer angle of zero
188       degrees, because the GD arc filling function will draw a complete
189       circle for that case.
190       Credit to Viacheslav <webdeveloper.ua at gmail.com> for finding this.
191
192     * Removed 8 of the functions (class methods) marked 'deprecated'.  Only
193       deprecated functions which seem to have been for internal use have
194       been removed. Even old scripts shouldn't be using them, and they are
195       becoming a problem to maintain.
196       Removed: SetImageArea() DrawDotSeries() DrawLineSeries() CalcXHeights()
197       CalcYWidths() DrawLabels() InitImage() DrawDashedLine().
198
199 2007-10-20 (lbayuk)     ===== Released as 5.0.4 =====
200     * phplot.php: Updated copyright, version, and authors comments at top.
201     * README.txt: Updated for new release
202     * NEWS.txt: Add text for new release
203
204 2007-10-18 (lbayuk)
205     * Add callbacks - experimental feature:
206       New functions SetCallback, GetCallback, RemoveCallback.
207       New internal function DoCallback.
208       Added callback hooks to DrawGraph.
209
210       Re-arranged code in DrawGraph to bring pie chart drawing into the main
211       switch on plot type, rather than a special case in its own block. This
212       makes it easier to follow and easier to add callback hooks.
213
214     * Callbacks: New file, documentation for the new callbacks feature.
215       (This won't be in the manual while it is an experimental feature.)
216
217 2007-10-15 (lbayuk)
218     * Fix for bug 1813021: Miss-positioned right-justified vertical GD text.
219       Fixed DrawText() to correctly position 90 degree right-justified text
220       drawn in a fixed GD font. This could be seen with 90 degree Y tick
221       labels. (Found by accident while working on TrueType text problems.)
222       Also some code cleanup in DrawText: use elseif where appropriate.
223
224 2007-10-09 (lbayuk)
225     * Code cleanup: Simplify SetIndexColor() and SetIndexDarkColor().
226       There is no need to first try ImageColorExact, then ImageColorResolve
227       if that fails. ImageColorResolve does all that for us.
228
229       Code cleanup: Rewrite SetRGBColor(). It now detects if an unrecognized
230       color name or color value form is used, and draws an error message.
231       Before this it would get a PHP index error and "headers already sent"
232       condition.
233
234     * Code cleanup: Remove duplicated code for loading image files.
235       Added new class-private function GetImage() which loads an image based
236       on the image type, and also returns the image size. This replaces
237       duplicated code in tile_img() and SetInputFile().
238       Also fixed comment at top of SetImageFile which said it was deprecated.
239       It isn't - it is used by the constructor. Moved the function out of the
240       'deprecated' area up to below where it is used.
241
242     * Code cleanup: PHPlot should not define or affect anything outside its
243       own class.
244       - Removed the check for __FUNCTION__ (PHP 4.3 and up). This is obsolete.
245       - Do not set error_reporting to E_ALL. Although it is recommended that
246       scripts do this, it is not the place of loaded classes to do it.
247       - Remove unused global constant TOTY.
248       - Removed constants MAXY and MINY. Global constants like this are bad.
249       These were used as magic index values into data[] to hold min and max Y
250       values for the row. Instead, put them in separate arrays which are
251       named data_miny[] and data_maxy[]. (This seems to be only used by the
252       data line drawing function.)
253
254       Comment cleanup: Remove one commented-out partial function DrawPlotLabel,
255       and fix another commented-out code fragment in DrawYErrorBar. Both of
256       these had unmatched braces in them which caused a balance-braces check
257       to fail.
258
259     * Code cleanup, array padding: Get rid of functions outside the class
260       and remove the interim fix for PHP 5 (which changed the behavior of
261       array_merge).  Rewrote external function array_pad_array() as a new
262       class function pad_array().  It does not need access to the class,
263       but I don't think PHPlot should add to the global namespace more
264       than necessary.  The third argument (array to use for padding) was
265       never used, so it was removed. It always pads the array with itself.
266       It now only works on 'usual integer indexed' arrays (0-based
267       sequential integer index). The was previously required but
268       undocumented for some of the arrays (like line_widths); now it is
269       required for all style arrays and will be documented. Now we can pad
270       the array to the required length, not just N times its previous
271       length, and we don't need array_merge.  Deleted external function
272       array_merge_php4() as it is no longer used.
273
274       Deleted PHP end marker ?>. You don't need this and it can cause
275       problems with extra whitespace in your output.
276
277 2007-09-24 (lbayuk)
278     * Code cleanup: Fix ternary operator misuse.  This doesn't change
279       behavior, but it was annoying me so I fixed it.
280       Replaced all cases of code like this: $a = ($a > $b) ? $b : $a
281       With just: if ($a > $b) $a = $b
282
283     * Fix Makefile 'release' target to set owner/group when creating
284       the tar file. This avoids having to run it as root, but it needs
285       GNU tar to work.
286
287 2007-09-08 (lbayuk)
288     * Fix for bug 1790441: Removed the PHPlot quasi-destructor function and
289       the register_shutdown_function() call which arranged for it to be used.
290       This was preventing release of memory when a PHPlot object was unset,
291       because the registered shutdown function held a reference to it.
292       So rather than improving memory use, it had the opposite effect.
293         Note: It is no longer necessary or recommended to use reference
294         assignment ($plot =& new PHPlot) for PHPlot object creation.
295       Thanks to annajilly for the thorough analysis, bug report, and fix.
296
297 2007-09-05 (lbayuk)
298     * Rewrote FormatLabel() to ignore blank label values. Adapted from a
299       patch and feature request submitted by Gerhard Reithofer (exgerhardr).
300       Blank labels used to produce an error if the LabelType was set to
301       'time', and zero if set to 'data'. Now they are just ignored. This
302       provides a simple way to have labels only at selected intervals when
303       using time or data formats. For example, you can have a date/time
304       label at every 10th data point by setting the labels for the other 9
305       to be empty strings. Also: Removed $which_pos values 'plotx' and
306       'ploty'.  These were unused by PHPlot and this is an internal-only
307       function so there is no compatibility issue. Removed error checking on
308       $which_pos for the same reason; the error message used an undefined
309       variable anyway so it wouldn't have worked.
310
311 2007-08-26 (lbayuk)
312     * Allow SetLegendStyle colorbox_align argument to be 'none', to suppress
313       the colorboxes in the legend.
314
315       Fix comment on $legend_text_align: empty means right, not left.
316
317       Rewrote DrawLegend layout code to make it easier to understand. The
318       result should be within 1 or 2 pixels of the previous size and position.
319
320     * Fixes for bug 1779115: SetLegendWorld() fails on undefined vars
321       Store the given coordinates and remember that they need to be converted
322       from world to pixel coordinates, but defer trying to actually convert
323       them until it is time to draw the legend. This way, there are no
324       problems with the scale having to being set up first (which is nearly
325       impossible to do).  Made the following changes:
326
327         Changed legend class variables to be uninitialized, and unset (rather
328         than empty string) means use the defaults. Added a new variable:
329         $legend_xy_world. If it is set, (legend_x_pos, legend_y_pos) need to
330         be converted to pixel coords. If it is unset, they are already pixel
331         coords (or undefined, meaning defaults).
332
333         Changed usage of internal function DrawLegend(): removed all arguments.
334         X and Y were always the class variables anyway, and now it needs to
335         also use the new flag to tell it if X and Y are world or pixel coords.
336         The third argument was unused.
337
338         Removed third, unused, default NULL argument from SetLegendPixels and
339         SetLegendWorld.
340  
341         Changes to DrawLegend to convert x, y coords to pixel coordinates
342         if they came from SetLegendWorld. Also account for new usage of
343         the class variables: Test for unset to mean use default.
344
345 2007-08-04 (lbayuk)
346     * New feature: control legend text and color box alignment.
347       Adds a new function SetLegendStyle to adjust the alignment of the
348       text and the color boxes inside the legend.
349       Based on part of bug 1208054, contributed by David Hernández Sanz.
350
351 2006-12-02 (lbayuk)
352     * Fixes for bug 1605555: Y Data Labels use wrong font and not formatted.
353       Use y_label_font (not x_label_font) for Y Data Labels.
354       Use the formatted value for the label, not the original text.
355       (This applies to bar charts only, with the new Y data labels.)
356
357     * One fix for bug 1208054: Localization of number format.
358       If number formatting is enabled with 'data' format type, PHPlot previously
359       used dot for decimal point and comma for thousands separator, and there
360       was no way to change it.
361      
362       This fix adds a new function:
363                SetNumberFormat($decimal_point, $thousands_separator)
364       to set the separators.  In addition, if that function is not used,
365       PHPlot will now try to use locale-dependent separators. If locale
366       information is not available, it will fall back to the old defaults
367       of dot and comma.
368
369       Note: This change may have some negative effects. 1) If your locale is
370       "C" or "Posix", you might not get a thousands separator now by default.
371       You should be using a more specific locale. 2) If your PHP script is
372       forcing a specific locale with setlocale(), PHPlot will probaby undo
373       that because it uses setlocale(LC_ALL, '') to import locale information
374       from the environment.  We have to do that, or a locale set through
375       the environment is ignored. But it will override a manually set locale.
376
377     * Fix for bug 937944: X/Y Tick Counts
378       PHPlot could draw one too few Y tick marks, and one too many X tick marks.
379
380       Changed the code to stop drawing X (Y) tick marks when the current X (Y)
381       value exceeds the maximum X (Y) value plus a small fudge factor. The fudge
382       factor accounts for cumulative error when repeatedly adding a delta to
383       the X (Y) value.
384
385       Notes: The bug report was writting about Y tick counts only, but X tick
386       counts can also be wrong. The proposed fix in the bug report does not
387       work in all cases.
388
389       This fix changes the appearance of many plots which were missing the
390       top-most Y tick mark. The extra X-tick mark problem is less common.
391
392 ===== Released as 5.0rc3 =====
393
394 2006-11-13 (lbayuk)
395     * Fix for bug 1437912: x-axis label misalignment [bar charts]
396       The calculations were redone from scratch.
397       New control variable 'bar_extra_space', which works in addition to
398       'group_frac_width' to control how much extra space is around the bars.
399       Made bar widths match for 'stackedbars' and 1-bar-per-group 'bars'.
400
401       NOTE: This changes the appearance of charts. bars in 'stackedbars'
402       will now be thinner, and bars in 'bars' graphs will be thicker. I
403       saw no reason for them being different before.
404
405       This fix required fixing the positioning on the new bar data labels,
406       which was off before.  The bar data labels will now be centered.
407       Additional fixes to bar chart data labels:
408          For negative values, the label will center under the bar.
409          Fixed X-adjustment to account for shading.
410          Fixed to not suppress the data label if the value is 0.
411
412
413 2006-11-10 (lbayuk)
414     * Fix for bug 1594457: DrawError text wrap and background fix
415       Do error image white background correctly, and word-wrap the text.
416
417     * Fix for bug 1594458: Suppress lines or points in 'linepoints'
418       Don't draw X data labels twice for 'linepoints'.
419       Allow SetPointShapes value 'none' to suppress points, and allow
420       SetLineStyles value 'none' to suppress lines. This allows a 'linepoints'
421       graph to mix lines only, points only, and both on the same graph.
422
423
424 2006-11-09 (lbayuk)
425     * Fixes for bug 1446523:
426       + Wrong variable name in deprecated SetAxisFontSize()
427       + Fails to properly handle error if SetDataValues() was never
428         called, or not called with a data array.
429
430     * Fix for bug 1117122: Pie Chart ignores SetPlotAreaPixels
431       Don't let DrawGraph recalculate the plot area for pie charts if the
432       user already set it with SetPlotAreaPixels.
433
434       NOTE: This fix may slightly change the appearance of some pie charts,
435       whether or not they use SetPlotAreaPixels.
436
437     * Fix for bug 1103992: Wrong max Y calculated for stackedbars
438       Changes FindDataLimits to calculate max Y correctly. It was counting
439       the first Y value in each record twice, which is always wrong but
440       only affected stackedbars because the Y values are summed.
441
442     * Fix for bug 1096199: Wrong error bar colors in DrawDotsError.
443       Rewrites DrawDotsError to make it work like DrawLinesError to
444       correctly increment the record and color indexes.
445       Also fixes uninitialized x_now_pixels.
446
447     * Fix for bug 1096197: No borders on unshaded Draw[Stacked]Bars
448       Unshaded Bars and StackedBars covered the border with the rectangle.
449       The fix is to draw the rectangle, then the border.
450
451       NOTE: This fix changes chart appearance. Bars and Stacked Bars
452       will now get a black border around each bar by default, if you
453       turn off the 3D-shading. If you want borderless, unshaded bars
454       you need to use SetDataBorderColors to set the data border colors
455       to be the same as the data colors.
456
457     * Fix for bug 1333164: Negative data values, if string variables, result
458       in unfilled bars. The problem was a string-to-string compare of a
459       negative number with the empty string x_axis_position. Fixed by
460       initializing x_axis_y_pixels to 0 if SetXAxisPosition was not used.
461
462
463 2005-04-17 (afan)
464     * Fix for bug [ 1161072 ] SetInputFile warning, background overwrite
465
466     * Bug 1182672 fixed
467
468 2005-04-15 (afan)
469     * fix for bug: [ 1182666 ] Y Auto-scale rounds in wrong direction
470
471     * Fix for bugs 1144644 TrueType font path problems and 1106328 TTF
472       path/filename inconsistency
473
474     * Fix Bug: [ 1117120 ] X Title sizing uses Y Title font height
475
476 2005-04-13 (afan)
477     * Error in SetLineStyles() - does not accept an array argument
478
479
480 2005-03-29 (afan)
481     * Small typo fixed in SetYDataLabelPos
482
483     * Update SetDataLabelPos: For past compatability we accept plotleft,
484       ...but pass it to SetTickLabelPos
485
486 2005-03-26 (afan)
487     * Change to line 3802: data lables now work with multiple bars with *$idx
488
489 2005-03-25 (afan)
490     * Added Function DrawDataLabels to put data labels in world coords,
491       added call from DrawBars and modified SetYDataLabelPos to flag
492       whether or not to call DrawDataLabels.
493
494 2005-01-20 (migueldb)
495     * Many bugfixes reported and solved by L. J. Bayuk. Thanks!
496       + fixed bug #1096190
497       + FindDataLimits(): fixed bug #1096192
498       + CalcTranslation(): fixed bug #1101317
499       + DrawImageBorder(): fixed bug 1096200
500       + DrawXDataLabel(): fixed bug 1099879
501       + DrawDots(): fixed bug #1096194
502
503 ===== Released as 5.0rc2 =====
504
505 2004-10-24 (migueldb)
506     * array_merge_php4(): added to cope with the bug introduced by
507         the change in array_merge() from PHP4 to PHP5 (I haven't verified this)
508     * Fixed some divisions by zero, thanks to an old bug report.
509
510 2004-09-09 (migueldb)
511     * SetPointSize(): deprecated
512     * SetPointSizes(): added as replacement for SetPointSize().
513       Now able to set point sizes on a per line basis.
514     * SetPointShape(): deprecated.
515     * SetPointShapes(): added as replacement for SetPointShape().
516       Now able to set point shape on a per line basis.
517     * DrawDot(): now needs record number to decide which dot shape and
518       size to draw.
519     * CalcMargins(): dirty fix for x data label placing.
520     * tile_img(): fixed tile placement.
521
522 2004-06-14 (migueldb)
523     * SetXTickLabelPos() and others: more on the bug reported by Jo Demol.
524     * Fixed bug reported by Jo Demol.
525
526 2004-05-11 (migueldb)
527     * SetBgImage(): added.
528     * SetPlotAreaBgImage(): added.
529     * SetInputFile(): deprecated.
530     * DrawBackground(): now accepts images as backgrounds.
531     * DrawPlotAreaBackground(): now accepts images as backgrounds.
532     * tile_img(): internal method added.
533
534 ..........
535 Editor's Note: For older changes to PHPlot, please see the CVS logs.
Note: See TracBrowser for help on using the browser.