]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/external_packages/phplot/ChangeLog
bacula-web: Sync with Davide repos
[bacula/bacula] / gui / bacula-web / external_packages / phplot / ChangeLog
1 This is the Change Log for PHPlot.\r
2 The project home page is http://sourceforge.net/projects/phplot/\r
3 -----------------------------------------------------------------------------\r
4 \r
5 2011-01-15 (lbayuk)     ===== Released as 5.3.1 =====\r
6     * phplot.php: Updated version\r
7     * README.txt: Updated for new release\r
8     * NEWS.txt: Add text for new release\r
9 \r
10 2011-01-09\r
11     * Fixed some style / indent errors, and 1 redundant test.\r
12 \r
13 2011-01-03\r
14     * For bug 3143586 "Multiple plots per image - fixes & docs":\r
15       Make sure there is a documented way to reset PHPlot feature\r
16       settings, especially those for which the default settings result\r
17       in automatic calculated values. Where possible, calling a Set*()\r
18       function with no arguments should reset the feature to defaults.\r
19 \r
20       + Changed SetLegendPixels() arguments to be optional with default\r
21         NULL meaning reset to automatic positioning.\r
22 \r
23       + Fixed SetXAxisPosition() and SetYAxisPosition() to accept empty\r
24         string '' to mean reset to default automatic positioning.\r
25         Make arguments optional, defaulting to empty string.\r
26 \r
27       + Changed SetNumXTicks() and SetNumYTicks() arguments to be\r
28         optional with default empty string '' meaning reset to\r
29         of automatic calculation.\r
30 \r
31     * Changed SetPointShapes() to use CheckOptionArray(). This\r
32       simplifies the function with no change in operation.\r
33 \r
34     * Extend copyright years to 2011.\r
35 \r
36 2010-12-30\r
37     * Fix for bug 3147397 "Data colors missing with multiple plots":\r
38       + Do not truncate the data_colors and related arrays, so the full\r
39         set of colors will be available for subsequent plots on the image.\r
40         (Color indexes are still allocated in the image only as needed.)\r
41       + New internal functions GetColorIndexArray() and\r
42         GetDarkColorIndexArray(), replacing previous use of array_map().\r
43       + Removed internal function truncate_array() - no longer used.\r
44       + Changed SetColorIndexes(), NeedDataDarkColors(), and\r
45         NeedErrorBarColors() to only allocate the color indexes that will\r
46         be needed (instead of allocating all colors in the truncated color\r
47         descriptor arrays).\r
48 \r
49 2010-12-28\r
50     * Instead of throwing an error, SetLegend(NULL) now clears the legend\r
51       array. This can be useful with multiple plots on an image. Before\r
52       this change, only SetLegend(array()) did that (possibly by accident).\r
53 \r
54 2010-12-27\r
55     * Do not have SetDefaultStyles() call deprecated SetLabelColor().\r
56 \r
57     * Fixes for bug 3143586 "Multiple plots per image - fixes & docs":\r
58       + Fix DrawLegend so it doesn't forget that the legend position\r
59         was specified in world coordinates. This fixes the legend\r
60         position for plots after the first.\r
61       + Don't draw the image border more than once (although this would\r
62         probably have no impact on the resulting image). This parallels\r
63         the behavior for the main plot title and the image background.\r
64         Replaced member variables background_done and title_done with a new\r
65         member array done[] which will track when these elements were done.\r
66 \r
67 2010-12-06\r
68     * Fix comments above CalcPlotAreaWorld(). Deleted incorrect information\r
69       from before data-data-yx existed, and before DecodeDataType rewrite.\r
70 \r
71 2010-12-04 (lbayuk)     ===== Released as 5.3.0 =====\r
72     * phplot.php: Updated version\r
73     * README.txt: Updated for new release\r
74     * NEWS.txt: Add text for new release\r
75 \r
76 2010-12-03\r
77     * Feature request 3127005 "Ability to suppress X/Y axis lines":\r
78       Added SetDrawXAxis() and SetDrawYAxis() to control flags which\r
79       will suppress drawing the X or Y axis lines. (These lines were\r
80       probably the only PHPlot elements that could not be turned off.)\r
81       Changed DrawXAxis() and DrawYAxis() to conditionally draw the\r
82       axis lines.\r
83 \r
84 2010-11-28\r
85     * Feature request 3117873 "Data value labels in more plot types":\r
86       Implemented Data Value Labels for plot types points, lines,\r
87       linepoints, and squared.  Added 2 class variables which can be\r
88       set to control the distance and angle of the labels from points.\r
89       New internal function CheckDataValueLabels() calculates position\r
90       and text alignment for these labels.\r
91 \r
92     * Updated comments for Set[XY]DataLabelPos to match the text in\r
93       the manual, which was rewritten to clarify label types.\r
94 \r
95 2010-11-23\r
96     * Code cleanup. Moved some functions around to group "plot drawing\r
97       helpers" separately from "plot drawing". No changes to operation.\r
98 \r
99 2010-11-21\r
100     * Feature request 3111166 "Control legend colorbox width":\r
101       Added a class variable legend_colorbox_width which can be changed\r
102       to make the colorboxes wider or narrower.\r
103 \r
104 2010-11-16\r
105     * Feature request 3093483 "Investing support chart types":\r
106       Added 3 new plot types: Basic OHLC (Open/High/Low/Close), Candlesticks,\r
107       and Filled Candlesticks. Implemented with one new function to handle the\r
108       3 new plot types: ohlc, candlesticks, and candlesticks2.\r
109 \r
110 2010-11-11\r
111     * Moved information about plot types into a new static member array\r
112       plots[]. (This is an internal change with no impact on usage, but will\r
113       make it easier to add new plot types.) SetPlotType() no longer needs a\r
114       list of plot types to check, FindDataLimits() does not need to check for\r
115       specific plot types to to process the data array, and DrawGraph() uses\r
116       data from the array rather than knowing about all the plot types.\r
117 \r
118 2010-10-31\r
119     * Changed internal CalcBarWidths() to take two arguments which indicate\r
120       how it should calculate bar widths, rather than having it check the\r
121       plot_type directly. (Taken from another, experimental change. This\r
122       minimizes places where plot_type is directly used.)\r
123 \r
124 2010-10-03 (lbayuk)     ===== Released as 5.2.0 =====\r
125     * phplot.php: Updated version\r
126     * README.txt: Updated for new release\r
127     * NEWS.txt: Add text for new release\r
128     * Makefile: Removed HorizontalBars.txt from release. This is now all\r
129           documented in the reference manual.\r
130 \r
131 2010-10-01\r
132     * Rewrite color handling. Default and specified colors are now validated,\r
133       converted to RGBA arrays, and saved. The colors indexes are not\r
134       allocated until graph drawing time. Unneeded colors are not allocated.\r
135 \r
136       Fix bug 3045131 "SetTransparentColor problems": Transparency setup is\r
137       deferred to graph drawing time, after most other colors are allocated.\r
138       Fixes SetTransparentColor order dependency, and works with data colors.\r
139 \r
140       Fix bug 3049726 "Optimize color allocation": Colors allocation is\r
141       deferred to graph drawing time, and colors for most elements are only\r
142       allocated if needed. In particular, the data colors and dark colors,\r
143       which used 32 slots, now only get defined as needed.\r
144 \r
145       Feature request (partial) 3077554 "Finer control over plot element\r
146       colors": The colors of the main, X, and Y titles can now be controlled\r
147       separately.\r
148 \r
149       Change details:\r
150       New internal functions:\r
151           GetColorIndex(), GetDarkColorIndex()\r
152               Allocate pre-parsed colors for elements.\r
153           SetColorIndexes()\r
154               Does the deferred color allocation and defaults.\r
155           NeedDataDarkColors(), NeedErrorBarColors()\r
156               Called by graph drawing functions if those colors are needed.\r
157           GetDataColor(), GetDataErrorColors(), GetBarColors()\r
158               Custom or standard data color assignment for most plot types.\r
159           truncate_array()\r
160              Shorten an array. Used to limit data color allocation.\r
161 \r
162       Removed internal functions:\r
163           SetIndexColor(), SetIndexDarkColor()\r
164               Unneeded. Color handling is now in two separate phases.\r
165 \r
166       Removed internal member variable:\r
167           data_colors_alpha\r
168               PHPlot no longer calls SetDataColors before plotting, so this\r
169               variable is not needed to preserve the default alpha.\r
170 \r
171       New internal member variables:\r
172           transparent_color\r
173               Saves color value from SetTransparentColor. For bug 3045131.\r
174           x_title_color, y_title_color, ndx_x_title_color, ndx_y_title_color\r
175               For title colors. DrawXTitle and DrawYTitle use them now.\r
176 \r
177       Changed internal member variables:\r
178           i_border, plot_bg_color, bg_color, label_color, text_color, etc.\r
179               All variables for colors now always hold a parsed 4-component\r
180               (RGBA) color specification as an array, and are no longer\r
181               statically initialized to a color name.\r
182 \r
183       New public functions:\r
184           SetXTitleColor(), SetYTitleColor()\r
185               These can be used to make the 3 titles have different colors.\r
186 \r
187 2010-09-26\r
188     * Don't let SetXDataLabelPos() accept 'xaxis' or 'all' as valid.\r
189       Don't let SetXTickLabelPos(), SetYTickLabelPos() accept 'all' as valid.\r
190       These were never implemented and never documented.\r
191 \r
192 \r
193     * Feature request #3073679 "Stacked bar plots with negative values":\r
194       Allow stacked bar plots (vertical and horizontal) to work with negative\r
195       values.  Changed FindDataLimits() to not take abs() values for\r
196       stackedbar when calculating the data range.  Changed DrawStackedBars()\r
197       and DrawHorizStackedBars() to handle negative values, including proper\r
198       label positions.  The first non-zero value in a row sets the direction\r
199       of the bar. Mixing positive and negative values within a row works but\r
200       the results are not useful.\r
201 \r
202     * New internal DrawBar() moves common code from 4 bars and stackedbars\r
203       drawing functions and makes it easier to deal with shading vs bar\r
204       direction.\r
205 \r
206 2010-09-24\r
207     * Fix bug 3074402 "Fix Y axis default for horizontal plots":\r
208       Make the default axis positions symmetrical for vertical plots\r
209       (X and Y) and horizontal plots (Y and X). This fixes the problem\r
210       with horizontal bar/thinbarline plots that have negative data,\r
211       where the Y axis stayed on the left and the bars went rightward.\r
212 \r
213 2010-09-01\r
214     * Fix bug 3056991 "Internal methods should be 'protected'":\r
215       Changed CheckDataArray(), number_format(), FindDataLimits(), and\r
216       DrawBackground() to be 'protected'. The test suite no longer calls\r
217       these directly. For SetIndexColor(), SetRGBColor(), DrawText(),\r
218       SizeText(), xtr(), and ytr(), left these as public with a comment\r
219       indicating they should be treated as protected.\r
220 \r
221     * Fix bug 3057000 "Review 'deprecated' methods":\r
222       + Changed deprecated method SetNewPlotAreaPixels() to just call\r
223       SetPlotAreaPixels(). It was suspicious as coded, and was found\r
224       to be equivalent to SetPlotAreaPixels().\r
225       +  Removed SetColor(), which didn't do anything. It was calling\r
226       SetRGBColor and discarding the result. After reviewing the\r
227       history of this in all CVS versions, it does not seem to have\r
228       ever been coded correctly, so there is no harm in removing it.\r
229       + All other deprecated methods seem OK and are left as is.\r
230 \r
231 2010-08-30 (lbayuk)     ===== Released as 5.1.3 =====\r
232     * phplot.php: Updated version\r
233     * README.txt: Updated for new release\r
234     * NEWS.txt: Add text for new release\r
235 \r
236 2010-08-27\r
237     * Fix bug 3051832 "Let PHP/GD find the font file":\r
238       Instead of checking for file existence, PHPlot now uses a non-drawing GD\r
239       operation to validate a TrueType font in SetFontTTF(). This allows GD to\r
240       use its internal search path, making it likely that fonts can be found\r
241       without needing a platform-dependent path in your script.  Full paths\r
242       will still work, so there is no compatibility issue.\r
243 \r
244     * Fix bug 3051906 "Better choice for default TT font":\r
245       Removed "benjamingothic.ttf" as the default TT font setting. This has\r
246       not been included in PHPlot since 2004. Changed SetFontTTF() to call\r
247       new GetDefaultFontTTF(), which will try a number of sans-serif font\r
248       names the first time it needs a default TT font. Considering the above\r
249       fix to finding fonts, this has a good chance of finding a working\r
250       font. It is known to work on Windows and some Linux distributions.\r
251 \r
252 2010-08-19\r
253     * Makefile: Removed phplot_data.php from list of files to release.\r
254       Reference bug report 3048267. This file has not been maintained or\r
255       tested, and has bugs.  It will remain in CVS, but not be included\r
256       in PHPlot releases.\r
257 \r
258 2010-08-17\r
259     * Change new DrawLinePoints(). It does not have to check and\r
260       handle error bar plots, as DrawDots and DrawLines will do that.\r
261 \r
262 2010-08-16\r
263     * Rewrote DecodeDataType(). Previous implementation was hard to\r
264       extend and inefficient. Now it uses new class variables (not a\r
265       returned array) and is only called once, by DrawGraph. Changed all\r
266       users of data_type to use the new variables.\r
267 \r
268       In CheckDataArray(), calculate data_columns properly for\r
269       text-data-single data type (pie chart) too. Simplify DrawPie\r
270       to use this, and merge 2 of the 3 cases.\r
271 \r
272       Have a single function handle each plot type, so it can properly\r
273       check the data type and report a correct error message showing\r
274       all supported types. For example, DrawBars is now the entry point\r
275       for both bars and horizontal bars; DrawGraph does not directly\r
276       call DrawHorizBars. Similar for DrawStackedBars and\r
277       DrawHorizStackedBars.  Lines, Points, and Linepoints also now\r
278       have a single function each, dispatching to others as needed.\r
279       (These changes were split off from an upcoming, larger change.)\r
280 \r
281 2010-08-14\r
282     * Fixes to SetDataValues: need to clear out the 2 arrays before\r
283       setting values in a loop, else if the function is used more than\r
284       once then old values will remain.\r
285       Move records_per_group calculation outside the loop.\r
286       (These were split off from upcoming, larger changes.)\r
287 \r
288     * Part 4 of horizontal plots: implement horizontal thinbarline plots.\r
289       Added new data type 'data-data-yx' (label, Y, X1, X2, ...).\r
290       DrawThinBarLines() now draws either vertical or horizontal plots, and\r
291       supports data types text-data, data-data, text-data-yx, data-data-yx.\r
292 \r
293       Fixed DecodeDataType() to handle text-data-single too, for completeness.\r
294 \r
295     * Fix for over-padding style and color arrays. These were padded to\r
296       records_per_group, but that is the maximum data array row size.\r
297       The number of actual data sets is less, and depends on the data type.\r
298       Calculate the correct number as data_columns at the top of DrawGraph,\r
299       and use that to pad the arrays. Also moved early error checking in\r
300       DrawGraph() into new CheckDataArray().\r
301 \r
302 2010-08-09\r
303     * Code cleanup. This is a large change to unify the comment and\r
304       coding stye used in PHPlot. The PEAR style guide is being used\r
305       as a reference, but PHPlot will never be 100% compliant.\r
306       This patch introduces no functional changes at all.\r
307         - Limit line length to 110.\r
308         - Remove obsolete, partially implemented Doxygen comments.\r
309         - Add descriptive comment above functions where missing.\r
310         - Use consistent comment markers and control structure spacing.\r
311         - Remove ctags-confusing end of function comments.\r
312         - Rewrote a few if/else blocks for cleaner logic.\r
313         - Re-order some functions for consistency (X, then Y).\r
314 \r
315 2010-08-04\r
316     * Implemented horizontal stacked bar plots:\r
317       Use the same data type introduced for horizontal bars, 'text-data-yx',\r
318       and the same plot type 'stackedbars', to make a horizontal stacked bar\r
319       plot.  Data value labels, both at the ends of the bars and within the\r
320       bars ('plotstack' labels) are available with horizontal stacked bars.\r
321 \r
322     * Internal function DrawDataLabel() is replaced by DrawDataValueLabel(),\r
323       with different usage. The new function can also check to see if a label\r
324       fits in the allocated space.\r
325 \r
326     * Fixed the text size check in stacked bar plots for data value labels\r
327       within the bars. The check only worked correctly for 0 degree labels. It\r
328       now works with any text angle. It suppresses the label if it is too high\r
329       (for vertical stacked bar plots) or too wide (for horizontal stacked bar\r
330       plots) to fit in the bar segment to which it belongs. Note that it only\r
331       checks in the bar direction. If the text is too wide (for vertical bars),\r
332       or too high (for horizontal bars), it will still be plotted, but will\r
333       cross the sides of the bar.\r
334 \r
335 2010-07-28\r
336     * Allow callbacks to return a value (to support new data_color callback).\r
337     * Feature request 3034164 "Extended control of data colors":\r
338       Define new callback 'data_color' for picking the data color.\r
339       Changed internal plot drawing functions DrawDots, DrawLines, DrawSquared,\r
340       DrawBars, DrawStackedBars, DrawDotsError, DrawThinBarLines,\r
341       DrawLinesError, and DrawHorizBars to use the data_color callback\r
342       (if defined) to select the data colors.\r
343     * SetRGBArray code cleanup (no functional changes).\r
344 \r
345 2010-07-27\r
346     * Fixes for error bars:\r
347       Code cleanup in DrawYErrorBar(), with no functional change.\r
348       Suppress duplicate drawing of error bars with 'linepoints' error plots.\r
349       This was already fixed for data labels. Now error bars will only be\r
350       drawn by the 'points' part, not the 'lines' part. There should be no\r
351       visible changes to plots. (This is needed for a future change).\r
352 \r
353 2010-07-26\r
354     * Horizontal bar charts (still an experimental feature) can now have data\r
355       value labels.\r
356     * HorizontalBars.txt: Fix incorrect description of bar direction. Add\r
357       text explaining the new data value labels.\r
358 \r
359 2010-06-29 (lbayuk)     ===== Released as 5.1.2 =====\r
360     * phplot.php: Updated version\r
361     * README.txt: Updated for new release\r
362     * NEWS.txt: Add text for new release\r
363 \r
364 2010-06-26\r
365    * Feature request 2885930 "Horizontal Bars":\r
366      Horizontal bar charts are implemented, as an experimental feature.\r
367      A new data type 'text-data-yx' was added, which works with\r
368      'bars' plot type to produce a horizontal bar chart from a data\r
369      array with X values for each Y value. Changes were made to\r
370      FindDataLimits, CalcMargins, CalcPlotAreaWorld, CalcBarWidths,\r
371      and CalcMaxDataLabelSize to handle the new data type. Other\r
372      changes were made to handle label position defaults and grid\r
373      defaults. New drawing functions were added for horizontal bars.\r
374 \r
375    * HorizontalBars.txt: new documentation file for experimental feature.\r
376    * Makefile: List new documentation file.\r
377 \r
378 2010-06-25\r
379    * Each plot-type drawing function now checks that it is getting a data\r
380      type that it knows how to handle. A new internal function unifies the\r
381      checking and error message. (This is associated with an upcoming,\r
382      bigger change.)\r
383 \r
384      Compatibility: If you were using an invalid data type for a plot type\r
385      whose function did not check, will now get an error.\r
386      \r
387    * Removed some dubious code from DrawLines() and DrawSquared() and\r
388      rewrote comments there. The code initialized lastx[0] and lasty[0],\r
389      but lasty was mapped using the X (rather than Y) function.  This was\r
390      obviously wrong, but closer inspection showed that the values were\r
391      never, used so the code was removed.\r
392 \r
393 2010-06-13\r
394    * Truecolor.txt: removed\r
395    * Makefile, README.txt: Removed reference to Truecolor.txt. Full\r
396      documentation for truecolor images is now in the Reference Manual.\r
397      \r
398 2010-06-02\r
399    * Fix bug 3010116 "Bad rendering of title in multi-plot image\r
400      when using TTF":\r
401      Make sure the main title is drawn only once. (If drawn multiple\r
402      times with TrueType font text, the anti-aliasing effects result\r
403      in poor quality text.)\r
404 \r
405 2010-05-31\r
406    * Improvements to truecolor support (from feature request 2947679):\r
407      Truecolor support is now better integrated. The derived class only\r
408      has the constructor now, and the base class itself provides the alpha\r
409      color component support through the internal functions SetIndexColor(),\r
410      SetIndexDarkColor(), and SetRGBColor(). This means alpha channel\r
411      works with palette images too (in so far as GD supports this).\r
412 \r
413    * Truecolor.txt: Updated per changes to truecolor support.\r
414 \r
415    * Image tiling with mode 'scale' in tile_img(), used with image and\r
416      plot area backgrounds, now uses imagecopyresampled() rather than\r
417      imagecopyresized(). They are the same with palette images, but the\r
418      resampled copy gets better results with truecolor images.\r
419 \r
420 2010-05-29\r
421     * Feature request 3002606 "Add to plot and image border options":\r
422         Added options 'right', 'top', and 'bottom' to SetPlotBorderType()\r
423       (existing options are 'left', 'sides', 'none', and 'full'). This\r
424       now also accepts an array of the above options, giving complete\r
425       control over which sides to draw.\r
426         Added option 'solid' to SetImageBorderType() to use the actual\r
427       color set with SetImageBorderColor(), rather than the darker\r
428       shade as type 'plain' does (for some reason).\r
429         New function SetImageBorderWidth() sets the width of the image\r
430       border. The image border width is now accounted for in margin\r
431       calculations, although existing plots will not change.\r
432 \r
433 2010-04-04 (lbayuk)     ===== Released as 5.1.1 =====\r
434     * phplot.php: Updated version\r
435     * README.txt: Updated for new release\r
436     * NEWS.txt: Add text for new release\r
437 \r
438 2010-04-01\r
439     * Remove & from argument in SetDataValues(). The data array is not\r
440       modified and does not need to be passed by reference. (There is\r
441       no performance advantage, either.)\r
442 \r
443 2010-03-29\r
444     * Feature request 2947679 "Support for alpha blending/Truecolor":\r
445       Implemented truecolor image support with a new class\r
446       PHPlot_truecolor, extended color specifications to allow\r
447       specification of an alpha value, and added a new optional parameter\r
448       to SetDataColors for a default alpha value for all data colors.\r
449       This feature is *EXPERIMENTAL* (see next item).\r
450 \r
451     * Truecolor.txt: New file, documentation for the new truecolor capability.\r
452       (The Truecolor feature is experimental, which means it is subject to\r
453       change in incompatible ways and the documentation has not yet been\r
454       incorporated into the PHPlot Reference Manual.)\r
455 \r
456     * Makefile: Include new documentation file in release.\r
457 \r
458 2010-03-26\r
459     Fixed bug 2976735 "Improvements and fixes for 'area' plots":\r
460     Rewrote DrawArea() function which handles 'area' plot.\r
461         Part 1: This is related to feature request 2947679, Truecolor support\r
462     with transparency. The area plot function was filling each area from the X\r
463     axis up to the Y value, resulting in area overlaps. This wasn't a problem\r
464     with opaque colors, but with transparency, the overlapping areas resulted\r
465     in changed colors. The rewritten function fills the area between each line\r
466     instead of from each line down to the X axis. Plots with opaque colors\r
467     will not change.\r
468         Part 2: Area plots now work when the X axis is moved up with\r
469     SetXAxisPosition().\r
470         Part 3: Fixed FindDataLimits() for area (and stackedbars too) to\r
471     take absolute values of Y values. The drawing function was doing this,\r
472     but not FindDataLimits, resulting in incorrect limits if any Y<0.\r
473         Part 4: The rewritten DrawArea() also handles a new plot type\r
474     'stackedarea'.  This is an area plot where the Y values are stacked,\r
475     similar to 'stackedbars'.\r
476         Note: As part of the changes, it is now an error to try an area plot\r
477     with an unequal number of Y points for each X.\r
478 \r
479 2010-03-23\r
480     * Feature request 2973995 "Add y-Data to Stackedbars":\r
481       Implemented Y Data Labels for Stacked Bar charts (stackedbars).\r
482       The labels are enabled with SetYDataLabelPos, same as with bar charts.\r
483       There are two types of labels: above the stack with the total, and\r
484       within the bars at each segment. 'plotin' turns on the upper ones, and\r
485       'plotstack' turns both on.\r
486 \r
487     * Other changes:\r
488       + Removed unimplemented second argument to SetYDataLabelPos.\r
489       + Fixed questionable logic in SetYDataLabelPos when given an argument\r
490         that belongs with SetYTickLabelPos.\r
491       + Fix comments at top of plot-type Draw functions.\r
492 \r
493     * Fix for bug 2974639 "Stacked bars plot breaks with X axis != 0":\r
494       Stacked bar plots with non-zero X axis position no longer break apart\r
495       into segments with gaps. The bars are drawn up from the X axis, and\r
496       any segments or partial segments below the X axis are not drawn.\r
497 \r
498 2010-03-22\r
499     * Change related to feature request 2947679 - Fix 'dot' point shape:\r
500       Use imagefilledellipse(), not imagefilledarc(), when drawing the 'dot'\r
501       point shape. The fix was needed for future support of truecolor images\r
502       with transparency, but filled dots from imagefilledellipse() look\r
503       better (rounder) with regular images and opaque colors.\r
504       Credit to mvaldez for identifying the problem and providing the fix.\r
505 \r
506 2010-03-04\r
507     * Fix for bug 2963757 "point_counts undefined error in 5.1.0":\r
508       Fixed CheckPointParams so it sets point_counts even when the point shape\r
509       and point size arrays are already the same size and do not need padding.\r
510 \r
511 2010-01-26\r
512     * Fix for bug 2938219 "Bars go in wrong direction":\r
513       Fixed CalcAxisPositions() to be consistent in positioning the X axis.\r
514       When all Y values are <0 and the Y=0 line is not part of the plot range,\r
515       PHPlot will now default the X axis to the top of the plot, not the\r
516       bottom.  This fixes the problem with bars to negative Y values being\r
517       drawn downward if Y=0 is visible, but upward if Y=0 is not visible.\r
518       This also affects thinbarline plots.\r
519       Credit to lauryn1298 for finding the bug.\r
520 \r
521 2009-12-24 (lbayuk)     ===== Released as 5.1.0 =====\r
522 \r
523 2009-12-18\r
524     * Change for bug 1795971 "Fix default data colors":\r
525       The default Data Color and Error Bar Color arrays now have 16\r
526       different colors, no duplicates, and nothing so light that it\r
527       is invisible.\r
528       Using '' or False as the argument to SetDataColors, SetErrorBarColors,\r
529       and SetDataBorderColors now re-initializes the map to the defaults.\r
530       This was previously undocumented, and in some cases set the map to\r
531       something different from the default.\r
532 \r
533 2009-12-15\r
534     * Cleanup: Remove DrawAxisLegend() - empty function marked TODO,\r
535       not really clear what it was meant to do.\r
536 \r
537 2009-12-14\r
538     * Fix for bug 2914403 "Pie + X/Y titles: Undefined property error":\r
539       In DrawGraph(), don't try to draw X or Y titles for pie charts.\r
540 \r
541     * Feature request 2899921: "allow different format for data and tick\r
542       labels"; Bug 2906436: "Fixes for X Tick Labels vs X Data Labels",\r
543       and partial implementation of changes from user 'adoll' regarding\r
544       tick vs data labels:\r
545 \r
546       New public functions:\r
547       + SetXDataLabelType() : Sets formatting for X Data Labels\r
548       + SetYDataLabelType() : Sets formatting for Y Data Labels (bar charts)\r
549       + SetXDataLabelAngle() : Sets text angle for X Data Labels\r
550       + SetYDataLabelAngle() : Sets text angle for Y Data Label (bar charts)\r
551       The defaults for these are set up to be fully backward compatible\r
552       with previous releases of PHPlot (except see the next item).\r
553 \r
554       Re-used function name SetXDataLabelAngle():\r
555       + This has been deprecated and undocumented since 2003-12-07, and\r
556         used to just call SetXLabelAngle(). For new behavior, see above.\r
557 \r
558       Changes to public functions:\r
559       + SetXDataLabelPos() and SetXTickLabelPos() no longer cancel each\r
560         other out (set the other control variable to 'none'). Instead,\r
561         they are both considered before plot drawing.\r
562 \r
563       Changes to internal functions:\r
564       + DrawDataLabel() now uses the font, angle, and color arguments as\r
565         provided, and does not substitute values if they are empty.\r
566       + SetLabelType() now takes mode='xd' and 'yd' for X Data and Y Data\r
567         label formatting; 'x' and 'y' are for tick labels only now.\r
568       + Functions that work on Data labels now call FormatLabel() with the\r
569         new mode parameter value 'xd' or 'yd, and use the new\r
570         data_label_angle variables.\r
571       + New CheckLabels(), used by DrawGraph to process label parameters.\r
572       + CalcMargins() - Rewritten to handle changes to Tick and Data labels.\r
573 \r
574       Changes to internal class variables:\r
575       + New: x_data_label_angle, y_data_label_angle\r
576       + Do not initialize x_tick_label_pos or x_data_label_pos, so that\r
577         CheckLabels() can tell if they were set or not and apply defaults.\r
578       + Initialize y_data_label_pos to 'none', not 'plotleft'.\r
579       + Add 2 more indexes to label_format[] array: 'xd' and 'yd'.\r
580 \r
581     * Cleanup:\r
582       + Delete unused internal class variable: draw_y_data_label_lines\r
583       + Delete unused function SetDrawYDataLabelLines()\r
584 \r
585 2009-12-07\r
586     * Fix bug 1795972 "Fix default point shapes":\r
587       +  Added 10 new point shapes to the existing 10 shapes.\r
588       +  Changed the default point shape from all 'diamond' to a\r
589          selection of up to 10 different shapes.\r
590       +  Fixed bug in the code that tried to set the point shapes\r
591          and sizes arrays to be the same size. This was not working,\r
592          resulting in unexpected point sizes.\r
593       +  Changed default point size to 6 for all shapes. It was trying\r
594          to be "5, 5, 3" but due to several bugs this was not working.\r
595       +  Do not adjust shape sizes to even numbers (was done for only two\r
596          shapes).  Instead, consistently truncate size/2 when needed.\r
597       NOTE: These may change the look of 'points' and 'linepoints' plots.\r
598 \r
599     * Changed startup initialization code:\r
600       +  SetDefaultStyles() was doing some odd things using a variable\r
601          called "session_set", with comments referring to non-existent\r
602          session support code. This has been removed. There should be\r
603          no visible changes from this. PHPlot does not use PHP sessions.\r
604 \r
605 2009-12-04\r
606     * Fix for bug 2908256, errors in pie charts with bad data array:\r
607       (From a Drupal contrib module report by thekevinday.)\r
608       With pie charts only, a data array with no valid Y values resulted\r
609       in PHP error messages. All other plot types handle this by producing\r
610       an image without a graph.\r
611       Fixed DrawPieChart to behave this way too. If there are no valid Y\r
612       values, or if the sum of all Y values is 0, do not error out, but\r
613       don't draw a pie chart either.\r
614       Also, pie charts now ignore non-numeric Y values, like other plot types.\r
615 \r
616 2009-11-20 (lbayuk)\r
617     * Fix for bug 2900914 "Problem with display of 0 on Y axis":\r
618       Changed how X and Y values are stepped by tick intervals, to avoid\r
619       cumulative round-off error. This fixes the problem when Y crosses 0 with\r
620       a tick step such as 0.1 resulting in a long label for a very small but\r
621       non-zero number. Fixed DrawXTicks, DrawYTicks, and CalcMaxTickLabelSize.\r
622       (Originally reported by cncnet)\r
623 \r
624 2009-11-19 (lbayuk)\r
625     * Improve support for using callbacks to annotate plots:\r
626       Added new callback 'draw_all', called after all drawing.\r
627       Supply plot_area[] as argument to some drawing callbacks.\r
628       Added new method GetDeviceXY() to translate from world coordinates.\r
629       Allow NULL or '' for $font in DrawText() internal method, meaning to\r
630           use the generic font. If callbacks want to use DrawText, this\r
631           avoids them having to reference the internal fonts[] array.\r
632 \r
633 2009-11-01 (lbayuk)\r
634     * Address bug report 2886365 "Declare all functions and variables in\r
635       PHP5 style"\r
636       PHP5 deprecates the use of 'var' to declare a class member variable.\r
637       All initialized class member variables are now declared 'public'.\r
638       (It was tempting to make most or all 'protected' or 'private', but\r
639       that would likely break too much, including the PHPlot Test Suite.)\r
640 \r
641       Most class member functions which are meant for internal use only are\r
642       now declared 'protected', so they cannot be called from scripts\r
643       (except in child classes). (Note PHP5 does not deprecate the use of\r
644       just 'function' to mean public, so public functions were not changed.)\r
645       Internal functions are those documented in the manual under Developer's\r
646       Guide, Internal Functions. If your code breaks because you are using\r
647       a method which is now protected, please post the details on the help\r
648       forum.\r
649 \r
650       Some member variables which were set in the constructor are now\r
651       initialized with the class instead. (No impact.)\r
652 \r
653       Removed commented-out, FIXME-noted code for interim labels.\r
654 \r
655 2009-10-12 (lbayuk)\r
656     * Bug report 2839547, allow SetImageBorderType('none') to reset the image\r
657       border type.  Also checked for other cases where there is no reset;\r
658       found one that exists (Set[XY]LabelType) but needs to be documented.\r
659 \r
660 2009-07-09 (lbayuk)\r
661     * Added a hook $plot->locale_override which can be set to True to prevent\r
662       PHPlot from loading locale settings from the environment with\r
663       setlocale(LC_ALL, ''). This is necessary for testing PHPlot on Windows,\r
664       where you cannot force a locale with an environment variable. It might\r
665       also be needed for people who want PHPlot's locale to differ from the\r
666       web server's locale.\r
667 \r
668 2009-06-12 (lbayuk)     ===== Released as 5.0.7 =====\r
669 \r
670 2009-06-11 (lbayuk)\r
671     * Change PHPlot license to LGPL, per Afan.\r
672         phplot.php, phplot_data.php - Change license notice.\r
673         rgb.inc.php - Change top comments and remove bottom marker.\r
674         COPYING - new file, text of LGPL.\r
675         LICENSE.* - removed files - old licenses.\r
676         Makefile - change list of distributed files.\r
677 \r
678     * Fix for bug 2803900: SetRGBArray('large') does not work. The include\r
679       file defined a different array name than the main script expected.\r
680       (This bug seems to have happened over 8 years ago.) Fixed the array\r
681       names to match. Also removed the ./ prefix from the included filename\r
682       so it will be found if on the include path but not in the script\r
683       directory.  Also added error check if the rgb.inc.php include file\r
684       is needed and not found.\r
685 \r
686 2009-05-25 (lbayuk)\r
687     * Added new feature to allow partial margin or plot area specification.\r
688       You can omit, or specify as NULL, any of the 4 arguments to\r
689       SetMarginsPixels() or SetPlotAreaPixels(), and this means PHPlot\r
690       should use the automatically calculated margin on that side.\r
691       Credit to adoll for this feature.\r
692 \r
693 2009-05-17 (lbayuk)\r
694     * Fix for bug 2791502 "Error plots treat missing Y values as 0":\r
695       Plots with data type data-data-error now support missing Y values,\r
696       instead of treating them as 0. This works with lines, points,\r
697       and linepoints plot types, and also honors SetDrawBrokenLines.\r
698 \r
699 \r
700     * Fix for bug 2792860 "Wrong DataLabelLines with missing Y":\r
701       Do not draw X Data Label Lines at points with missing Y values.\r
702 \r
703 \r
704     * Fix for bug 2786350 "Missing Y data results in bad auto-range":\r
705       Rewrote FindDataLimits to ignore missing Y values, rather than\r
706       treating them as if 0, for calculating range.\r
707       Bug report and analysis by mrten.\r
708 \r
709     * Fix for bug 2786354 "Incorrect auto-range for data-data-error":\r
710       For data-data-error data type, apply the positive and negative error\r
711       amounts for each Y point to that point only, rather than applying the\r
712       largest errors to the overall minimum and maximum Y value for the row.\r
713 \r
714     Note: The two fixes above can change existing plots which rely on\r
715       automatic Y range calculation. The first fix affects plots with\r
716       missing Y values and min(Y)>0. The second fix can affect plots using\r
717       data-data-error data type and different error values for different\r
718       points. In both cases the new Y range can be smaller than before.\r
719 \r
720 2009-01-20 (lbayuk)     ===== Released as 5.0.6 =====\r
721 \r
722 2009-01-18 (lbayuk)\r
723     * Fix for bug 1891636 "Misaligned TTF X Labels":\r
724           PHPlot was using the actual bounding box of each line of text\r
725       to allocate space and set the text positioning, but was ignoring the\r
726       fact that the text baseline is not the same as the bottom of the\r
727       bounding box. This resulted in uneven alignment of the X labels if\r
728       they had different heights (for example, month names Jul and Aug).\r
729 \r
730       PHPlot now calculates the size of text for allocation (SizeText) using\r
731       the descenders on the last line, and calculates the size for drawing\r
732       (DrawText) only to the baseline. PHPlot also now uses a fixed line\r
733       spacing for each line of text in a font, rather than the actual text\r
734       height. This allows separately drawn multi-line labels to align.\r
735 \r
736     * Changes to line spacing when using multi-line labels:\r
737           PHPlot was using the class variable line_spacing to mean the\r
738       number of pixels between lines of multi-line labels. This made the\r
739       spacing too small for larger fonts, and it was not possible to adjust\r
740       line spacing for different types of text.\r
741 \r
742           PHPlot now interprets line_spacing as the number of pixels only\r
743       for GD text, and as a scale factor for the font's built-in line\r
744       spacing for TrueType text. In addition, a new optional argument is\r
745       added to SetFont, SetFontGD, and SetFontTTF to set a line spacing\r
746       specific to that type of text.\r
747 \r
748     * Changes had to be made to the legend drawing code to accommodate the\r
749       changes to font handling.\r
750 \r
751       Note: The line spacing change results in slightly looser spacing on\r
752       multi-line TrueType text labels, and slightly taller legends, compared\r
753       to version 5.0.5.\r
754 \r
755 2008-09-21 (lbayuk)\r
756     * Interim fix for bug 1932571 "Data-Data Plot fails with same X values".\r
757       PHPlot will no longer hang when the range of X values is 0 (that is, when\r
758       x_min == x_max). It will arbitrarily set an X range of 1, so the\r
759       calculated tick step is not 0. This is a temporary fix. Work on a smarter\r
760       X and Y range calculation is in progress, which will handle edge cases\r
761       like this better, but it isn't ready and this bug has been open too long.\r
762       Credit to andyl for finding the bug.\r
763 \r
764     * Fix font path: Use DIRECTORY_SEPARATOR constant not '/'.\r
765 \r
766     Extended the label formatting capabilities, adding 'printf' and 'custom'\r
767     types, added a prefix and suffix for 'data' type, and allow format controls\r
768     to be included in SetXLabelType and SetYLabelType.\r
769 \r
770     External changes:\r
771     * Added 'printf' label type. The caller specifies the print format as the\r
772       2nd argument to SetXLabelType or SetYLabelType (default '%e').\r
773              $plot->SetXLabelType('printf', '%5.2f');\r
774 \r
775     * Added 'custom' label type. The caller supplies a callback (typically a\r
776       function name) and optional pass-through argument as the 2nd and 3rd\r
777       arguments to Set[XY]LabelType.  The function is called as $f($value, $arg)\r
778       to return the formatted $value.\r
779              $plot->SetXLabelType('custom', 'myfunction', $arg_value);\r
780 \r
781     * In addition to Set[XY]TimeFormat, the format string for type 'time' can\r
782       now be set as the 2nd argument to Set[XY]LabelType.\r
783              $plot->SetXLabelType('time', '%H:%M');\r
784 \r
785     * In addition to SetPrecision[XY], the precision for type 'data' can now be\r
786       set as the 2nd argument to Set[XY]LabelType. A 3rd and 4th argument\r
787       can supply a prefix and suffix for 'data' formatting. (All optional)\r
788              $plot->SetXLabelType('data', 2, '$', 'US');\r
789 \r
790     Internal changes:\r
791     * Class variables x_precision, y_precision, x_label_type, y_label_type,\r
792       x_time_format, and y_time_format have been removed.\r
793 \r
794     * New class array variable label_format[], with elements 'x' and 'y' which\r
795       are arrays for label formatting. Elements in the sub-arrays are not\r
796       initialized until needed.\r
797 \r
798     * New function SetLabelType, which implements Set[XY]LabelType now.\r
799 \r
800     * FormatLabel() was rewritten to support the new label formatting.\r
801 \r
802     Compatibility:\r
803     * Any code that directly references class variables related to label\r
804       formatting will break, except for data_units_text. Use the documented\r
805       function methods instead.  Setting data_units_text as a suffix is\r
806       deprecated but still works.\r
807 \r
808     * The 'data' type precision for 'Y' is still used for pie chart labels.\r
809 \r
810 2008-07-12 (lbayuk)\r
811     Multiple comment spelling error fixes. No functional changes.\r
812 \r
813 2008-07-06 (lbayuk)\r
814     Changes to allow mixing GD fixed-font text and TrueType Font (TTF) text\r
815     on the same plot.\r
816     (This change came from work done trying to fix TTF text positioning,\r
817     where it looks like additional information needs to be stored for TrueType\r
818     fonts. The old font data structure was awkward to extend, and allowing\r
819     mixed GD/TTF text was on the to-do list anyway.)\r
820 \r
821     External changes:\r
822     * SetFontGD(), SetFontTTF(): New functions to set a font, with type.\r
823     * SetFont(): Now calls SetFontGD or SetFontTTF depending on $use_ttf.\r
824     These changes should be fully compatible with existing programs.\r
825 \r
826     Internal changes:\r
827     * Updated comments explaining SetUseTTF() now sets the default type\r
828       (not the only type) of text used.\r
829     * Put all the font data into a class array. (Replaces $this->generic_font\r
830       with $this->fonts['generic'], etc.)\r
831     * ProcessTextGD() and ProcessTextTTF() now take the font array as one\r
832       argument, rather than separate arguments for font path and size.\r
833 \r
834 2008-01-13 (lbayuk)     ===== Released as 5.0.5 =====\r
835     * phplot.php: Updated version\r
836     * README.txt: Updated for new release\r
837     * NEWS.txt: Add text for new release\r
838     * Makefile: Remove 'Callbacks' from release target, as this material is\r
839       now in the reference manual.\r
840 \r
841 2008-01-07 (lbayuk)\r
842     Copyright updated to 2008 and PHP4 no longer listed as supported.\r
843 \r
844     Major rewrite of the margin calculation functions to address multiple\r
845     problems.  Fixes for bugs 1856207 "Margin error with 'xaxis'/'yaxis'\r
846     position, 1843012 "Make margins, drawing consistent", and 945439\r
847     "x_tick_label_height not set correctly".\r
848 \r
849     Note: These changes are inter-dependent and cannot be split up.\r
850 \r
851     * Defer all calculations to DrawGraph time, to eliminate order dependencies.\r
852       These functions now just store their arguments in the object, and all\r
853       calculations happen later:\r
854     + SetXAxisPosition, SetYAxisPosition\r
855     + SetMarginsPixels\r
856     + SetPlotAreaPixels (Stores margins, not area, now.)\r
857     + SetPlotAreaWorld\r
858     + SetXTickIncrement, SetYTickIncrement\r
859 \r
860     * A new callback 'debug_scale' was added to trace the margin and scale\r
861       calculations.\r
862 \r
863     * CalcMargins was rewritten. Actual sizes of tick and data labels are now\r
864       used, rather than guesses like "use size of biggest Y value". A minimum\r
865       value (3 x safe_margin, or 15 pixels) applies to each margin.\r
866 \r
867     * FindDataLimits no longer needs to find the longest data label, since\r
868       CalcMargins now does that more precisely.\r
869 \r
870     * DrawXTitle and DrawYTitle now use position offsets calculated by\r
871       CalcMargins. Note: These titles are now offset from the plot area,\r
872       not the image area. The titles will move if you had set the plot area\r
873       or margins.\r
874 \r
875     * DrawYTick, DrawXTick rewritten to use pre-calculated offsets, and common\r
876       code moved to new CalcTicks().\r
877 \r
878     * DrawXDataLabel: Use pre-calculated offsets for text.\r
879 \r
880     * DrawGraph: Rewrote top section (before drawing anything) to do the\r
881       calculations in the proper order, unconditionally.\r
882 \r
883     * Class variables removed:\r
884       x_label_inc, y_label_inc, _x_label_cnt : These were never used.\r
885       title_height, x_title_height, y_title_width : Now internal to CalcMargins.\r
886       data_limits_done : No more need to remember if FindDataLimits called.\r
887 \r
888     * New class variables added:\r
889       plot_margins_set : Keeps track of user-set plot area or automatic.\r
890       x_label_top_offset, x_label_bot_offset, x_offset_axis_offset,\r
891           y_label_left_offset, y_label_right_offset, y_label_axis_offset,\r
892           x_title_top_offset, x_title_bot_offset,\r
893           y_title_left_offset, y_title_left_offset : Label offsets\r
894       \r
895     * New internal functions:\r
896       CalcPlotAreaPixels : Deferred calculations taken out of SetPlotAreaPixels\r
897         and SetMarginsPixels.\r
898       CalcPlotAreaWorld : Deferred calculations taken out of SetPlotAreaWorld.\r
899       CalcAxisPositions : Calculate axis positions, moved from CalcTranslation.\r
900       CalcTicks : Calculate X and Y tick interval. This still uses the\r
901         same simple method (basically range/10), but now we could drop in a new\r
902         algorithm much more easily. This is now also used by CalcMargins.\r
903         Code taken out of DrawXTicks and DrawYTicks.\r
904       CalcMaxTickLabelSize : So CalcMargins can use the exact tick label sizes.\r
905       CalcMaxDataLabelSize : So CalcMargins can use the exact data label sizes.\r
906       DrawXTick : Code split out from DrawXTicks for symmetry with DrawYTick.\r
907 \r
908 \r
909 2007-12-13 (lbayuk)\r
910     * Changed ProcessTextTTF() so SizeText() will return integers. It rounds\r
911       the calculated values up, so the bounding box really contains the text.\r
912       This also prevents unneeded float calculations in derived values.\r
913 \r
914 2007-12-09 (lbayuk)\r
915     Major rewrite of the text drawing functions to address multiple problems.\r
916     Note: These changes are inter-dependent and cannot be split up.\r
917 \r
918     * Fixed bug 1813070 "Bad position for multi-line TrueType text":\r
919       TTF text is now drawn line-by-line, not as a block, for proper\r
920       alignment and positioning.\r
921 \r
922     * Fixed bug 1813071 "Wrong title height for multi-line TTF text":\r
923       Corrected miscalculation of overall height of multi-line TTF titles.\r
924       This bug resulted in over-sized margins.\r
925       The height is now computed line-by-line, including the inter-line spacing.\r
926 \r
927     * Fixed bug 1813474 "DrawText alignment arguments wrong":\r
928       Corrected meaning of 'top' vs 'bottom' alignment. PHPlot now follows\r
929       the usual conventions: 'top' alignment means top of text to reference.\r
930       DrawText default for vertical alignment is still 'bottom', but the\r
931       meaning was corrected.  All callers of DrawText were fixed.\r
932 \r
933     * Fixed bug 1816844 "Fix order dependency for setting titles":\r
934       Defer processing titles strings until DrawGraph(), so there is no\r
935       more order dependency (no need to set font before setting title strings).\r
936 \r
937     * Fixed bug 1819668 "Horiz. align multi-line text: GD vs TTF":\r
938       The new text routines draw TTF text line-by-line and correctly do\r
939       right-, center-, and left- alignment of each line within a text block.\r
940 \r
941     * Fixed bug 1826513 "FIXME in DrawLegend: Max label length":\r
942       Use actual width of widest legend line to calculate legend box size.\r
943 \r
944     * Partial fix for bug 945439 "x_tick_label_height not set correctly":\r
945       In FindDataLimits(), save the longest data label, not just its length,\r
946       and use the actual rendered size of that string in CalcMargins() for\r
947       the margin calculations.\r
948       Also take into account which of the tick or data labels are visible.\r
949       This is not a complete fix, but is a significant improvement.\r
950 \r
951     The following changes were made related to the above fixes:\r
952 \r
953     + Replaced internal function TTFBBoxSize(), which didn't work right, with\r
954       SizeText(). It returns the orthogonal bounding box of a block of text,\r
955       and works with both GD and TTF text.\r
956 \r
957     + DrawText() and SizeText() call a single function ProcessText(), which is\r
958       the only place GD text and TTF text are distinguished. (So eventually\r
959       we will be able to mix GD and TTF text on a plot.)\r
960 \r
961     + New internal functions ProcessTextGD() and ProcessTextTTF() draw (or size)\r
962       GD and TTF text respectively. These are only called by ProcessText().\r
963       These are re-implementations which properly position and align text.\r
964 \r
965     + Removed class variables title_angle, x_title_angle, and y_title_angle. The\r
966       titles only work at their fixed angles anyway (0, 0, and 90 respectively).\r
967 \r
968     + Line spacing set with SetLineSpacing() now affects TTF text as well as\r
969       GD text. Previously, it only affected GD text. The default line spacing\r
970       happens to be usable for TTF text.\r
971 \r
972     + Added new callback hook 'debug_textbox' for developing, testing, and\r
973       documenting. It provides access to the text area bounding box.\r
974 \r
975     + Removed unneeded class variables x_tick_label_height, y_tick_label_width,\r
976       x_tot_margin, y_tot_margin.\r
977 \r
978 2007-11-25\r
979     * Improve error handling:\r
980       Internal functions PrintError() and DrawError() are now the same. Both\r
981       will draw the error message into the image and output it, and then\r
982       trigger a user-level error. If no error handler has been set, it will\r
983       exit, as before. But now the error message should also get logged, or\r
984       written to the standard error stream, depending on the SAPI in use.\r
985       You can now establish an error handler to catch most PHPlot errors and\r
986       do some cleanup before exit.\r
987 \r
988       This fix also covers bug #1823774 "Default Font Path and Error Message\r
989       Output".\r
990 \r
991       Fixed the return value of most PHPlot functions, to return False on\r
992       error, else True. Since uncaught errors are fatal anyway, this only\r
993       affects code with an error handler that returns, which is not\r
994       recommended and unsupported at this time. These changes are for\r
995       possible future error handling options.\r
996 \r
997 2007-11-22\r
998     * Fix bug 1836528 "Insufficient checking of parameter values":\r
999       Rewrote CheckOption to correctly validate option choices.\r
1000       (It previously accepted substrings and other incorrect values.)\r
1001       PHPlot methods that use CheckOption now must be called with valid option\r
1002       values. Empty strings are also no longer accepted.\r
1003 \r
1004 2007-11-17 (lbayuk)\r
1005     * Change to callbacks to support extra arguments.\r
1006       The PHPlot class can now pass extra arguments to a callback function.\r
1007       Callback functions now take the following form:\r
1008           my_callback($img, $passthru_arg, ...)\r
1009       Where '...' is zero or more additional arguments supplied by PHPlot to\r
1010       the callback. Each implemented callback reason will define any\r
1011       additional arguments it uses. The existing defined callbacks have not\r
1012       changed and do not currently pass any extra arguments.\r
1013 \r
1014 2007-11-10 (lbayuk)\r
1015     * Fix bug 1827263 "Spoiled up pie-chart if $val is close to zero":\r
1016       Skip pie slices which would result in an integer angle of zero\r
1017       degrees, because the GD arc filling function will draw a complete\r
1018       circle for that case.\r
1019       Credit to Viacheslav <webdeveloper.ua at gmail.com> for finding this.\r
1020 \r
1021     * Removed 8 of the functions (class methods) marked 'deprecated'.  Only\r
1022       deprecated functions which seem to have been for internal use have\r
1023       been removed. Even old scripts shouldn't be using them, and they are\r
1024       becoming a problem to maintain.\r
1025       Removed: SetImageArea() DrawDotSeries() DrawLineSeries() CalcXHeights()\r
1026       CalcYWidths() DrawLabels() InitImage() DrawDashedLine().\r
1027 \r
1028 2007-10-20 (lbayuk)     ===== Released as 5.0.4 =====\r
1029     * phplot.php: Updated copyright, version, and authors comments at top.\r
1030     * README.txt: Updated for new release\r
1031     * NEWS.txt: Add text for new release\r
1032 \r
1033 2007-10-18 (lbayuk)\r
1034     * Add callbacks - experimental feature:\r
1035       New functions SetCallback, GetCallback, RemoveCallback.\r
1036       New internal function DoCallback.\r
1037       Added callback hooks to DrawGraph.\r
1038 \r
1039       Re-arranged code in DrawGraph to bring pie chart drawing into the main\r
1040       switch on plot type, rather than a special case in its own block. This\r
1041       makes it easier to follow and easier to add callback hooks.\r
1042 \r
1043     * Callbacks: New file, documentation for the new callbacks feature.\r
1044       (This won't be in the manual while it is an experimental feature.)\r
1045 \r
1046 2007-10-15 (lbayuk)\r
1047     * Fix for bug 1813021: Miss-positioned right-justified vertical GD text.\r
1048       Fixed DrawText() to correctly position 90 degree right-justified text\r
1049       drawn in a fixed GD font. This could be seen with 90 degree Y tick\r
1050       labels. (Found by accident while working on TrueType text problems.)\r
1051       Also some code cleanup in DrawText: use elseif where appropriate.\r
1052 \r
1053 2007-10-09 (lbayuk)\r
1054     * Code cleanup: Simplify SetIndexColor() and SetIndexDarkColor().\r
1055       There is no need to first try ImageColorExact, then ImageColorResolve\r
1056       if that fails. ImageColorResolve does all that for us.\r
1057 \r
1058       Code cleanup: Rewrite SetRGBColor(). It now detects if an unrecognized\r
1059       color name or color value form is used, and draws an error message.\r
1060       Before this it would get a PHP index error and "headers already sent"\r
1061       condition.\r
1062 \r
1063     * Code cleanup: Remove duplicated code for loading image files.\r
1064       Added new class-private function GetImage() which loads an image based\r
1065       on the image type, and also returns the image size. This replaces\r
1066       duplicated code in tile_img() and SetInputFile().\r
1067       Also fixed comment at top of SetImageFile which said it was deprecated.\r
1068       It isn't - it is used by the constructor. Moved the function out of the\r
1069       'deprecated' area up to below where it is used.\r
1070 \r
1071     * Code cleanup: PHPlot should not define or affect anything outside its\r
1072       own class.\r
1073       - Removed the check for __FUNCTION__ (PHP 4.3 and up). This is obsolete.\r
1074       - Do not set error_reporting to E_ALL. Although it is recommended that\r
1075       scripts do this, it is not the place of loaded classes to do it.\r
1076       - Remove unused global constant TOTY.\r
1077       - Removed constants MAXY and MINY. Global constants like this are bad.\r
1078       These were used as magic index values into data[] to hold min and max Y\r
1079       values for the row. Instead, put them in separate arrays which are\r
1080       named data_miny[] and data_maxy[]. (This seems to be only used by the\r
1081       data line drawing function.)\r
1082 \r
1083       Comment cleanup: Remove one commented-out partial function DrawPlotLabel,\r
1084       and fix another commented-out code fragment in DrawYErrorBar. Both of\r
1085       these had unmatched braces in them which caused a balance-braces check\r
1086       to fail.\r
1087 \r
1088     * Code cleanup, array padding: Get rid of functions outside the class\r
1089       and remove the interim fix for PHP 5 (which changed the behavior of\r
1090       array_merge).  Rewrote external function array_pad_array() as a new\r
1091       class function pad_array().  It does not need access to the class,\r
1092       but I don't think PHPlot should add to the global namespace more\r
1093       than necessary.  The third argument (array to use for padding) was\r
1094       never used, so it was removed. It always pads the array with itself.\r
1095       It now only works on 'usual integer indexed' arrays (0-based\r
1096       sequential integer index). The was previously required but\r
1097       undocumented for some of the arrays (like line_widths); now it is\r
1098       required for all style arrays and will be documented. Now we can pad\r
1099       the array to the required length, not just N times its previous\r
1100       length, and we don't need array_merge.  Deleted external function\r
1101       array_merge_php4() as it is no longer used.\r
1102 \r
1103       Deleted PHP end marker ?>. You don't need this and it can cause\r
1104       problems with extra whitespace in your output.\r
1105 \r
1106 2007-09-24 (lbayuk)\r
1107     * Code cleanup: Fix ternary operator misuse.  This doesn't change\r
1108       behavior, but it was annoying me so I fixed it.\r
1109       Replaced all cases of code like this: $a = ($a > $b) ? $b : $a\r
1110       With just: if ($a > $b) $a = $b\r
1111 \r
1112     * Fix Makefile 'release' target to set owner/group when creating\r
1113       the tar file. This avoids having to run it as root, but it needs\r
1114       GNU tar to work.\r
1115 \r
1116 2007-09-08 (lbayuk)\r
1117     * Fix for bug 1790441: Removed the PHPlot quasi-destructor function and\r
1118       the register_shutdown_function() call which arranged for it to be used.\r
1119       This was preventing release of memory when a PHPlot object was unset,\r
1120       because the registered shutdown function held a reference to it.\r
1121       So rather than improving memory use, it had the opposite effect.\r
1122         Note: It is no longer necessary or recommended to use reference\r
1123         assignment ($plot =& new PHPlot) for PHPlot object creation.\r
1124       Thanks to annajilly for the thorough analysis, bug report, and fix.\r
1125 \r
1126 2007-09-05 (lbayuk)\r
1127     * Rewrote FormatLabel() to ignore blank label values. Adapted from a\r
1128       patch and feature request submitted by Gerhard Reithofer (exgerhardr).\r
1129       Blank labels used to produce an error if the LabelType was set to\r
1130       'time', and zero if set to 'data'. Now they are just ignored. This\r
1131       provides a simple way to have labels only at selected intervals when\r
1132       using time or data formats. For example, you can have a date/time\r
1133       label at every 10th data point by setting the labels for the other 9\r
1134       to be empty strings. Also: Removed $which_pos values 'plotx' and\r
1135       'ploty'.  These were unused by PHPlot and this is an internal-only\r
1136       function so there is no compatibility issue. Removed error checking on\r
1137       $which_pos for the same reason; the error message used an undefined\r
1138       variable anyway so it wouldn't have worked.\r
1139 \r
1140 2007-08-26 (lbayuk)\r
1141     * Allow SetLegendStyle colorbox_align argument to be 'none', to suppress\r
1142       the colorboxes in the legend.\r
1143 \r
1144       Fix comment on $legend_text_align: empty means right, not left.\r
1145 \r
1146       Rewrote DrawLegend layout code to make it easier to understand. The\r
1147       result should be within 1 or 2 pixels of the previous size and position.\r
1148 \r
1149     * Fixes for bug 1779115: SetLegendWorld() fails on undefined vars\r
1150       Store the given coordinates and remember that they need to be converted\r
1151       from world to pixel coordinates, but defer trying to actually convert\r
1152       them until it is time to draw the legend. This way, there are no\r
1153       problems with the scale having to being set up first (which is nearly\r
1154       impossible to do).  Made the following changes:\r
1155 \r
1156         Changed legend class variables to be uninitialized, and unset (rather\r
1157         than empty string) means use the defaults. Added a new variable:\r
1158         $legend_xy_world. If it is set, (legend_x_pos, legend_y_pos) need to\r
1159         be converted to pixel coords. If it is unset, they are already pixel\r
1160         coords (or undefined, meaning defaults).\r
1161 \r
1162         Changed usage of internal function DrawLegend(): removed all arguments.\r
1163         X and Y were always the class variables anyway, and now it needs to\r
1164         also use the new flag to tell it if X and Y are world or pixel coords.\r
1165         The third argument was unused.\r
1166 \r
1167         Removed third, unused, default NULL argument from SetLegendPixels and\r
1168         SetLegendWorld.\r
1169  \r
1170         Changes to DrawLegend to convert x, y coords to pixel coordinates\r
1171         if they came from SetLegendWorld. Also account for new usage of\r
1172         the class variables: Test for unset to mean use default.\r
1173 \r
1174 2007-08-04 (lbayuk)\r
1175     * New feature: control legend text and color box alignment.\r
1176       Adds a new function SetLegendStyle to adjust the alignment of the\r
1177       text and the color boxes inside the legend.\r
1178       Based on part of bug 1208054, contributed by David Hernández Sanz.\r
1179 \r
1180 2006-12-02 (lbayuk)\r
1181     * Fixes for bug 1605555: Y Data Labels use wrong font and not formatted.\r
1182       Use y_label_font (not x_label_font) for Y Data Labels.\r
1183       Use the formatted value for the label, not the original text.\r
1184       (This applies to bar charts only, with the new Y data labels.)\r
1185 \r
1186     * One fix for bug 1208054: Localization of number format.\r
1187       If number formatting is enabled with 'data' format type, PHPlot previously\r
1188       used dot for decimal point and comma for thousands separator, and there\r
1189       was no way to change it.\r
1190       \r
1191       This fix adds a new function:\r
1192                SetNumberFormat($decimal_point, $thousands_separator)\r
1193       to set the separators.  In addition, if that function is not used,\r
1194       PHPlot will now try to use locale-dependent separators. If locale\r
1195       information is not available, it will fall back to the old defaults\r
1196       of dot and comma.\r
1197 \r
1198       Note: This change may have some negative effects. 1) If your locale is\r
1199       "C" or "Posix", you might not get a thousands separator now by default.\r
1200       You should be using a more specific locale. 2) If your PHP script is\r
1201       forcing a specific locale with setlocale(), PHPlot will probably undo\r
1202       that because it uses setlocale(LC_ALL, '') to import locale information\r
1203       from the environment.  We have to do that, or a locale set through\r
1204       the environment is ignored. But it will override a manually set locale.\r
1205 \r
1206     * Fix for bug 937944: X/Y Tick Counts\r
1207       PHPlot could draw one too few Y tick marks, and one too many X tick marks.\r
1208 \r
1209       Changed the code to stop drawing X (Y) tick marks when the current X (Y)\r
1210       value exceeds the maximum X (Y) value plus a small fudge factor. The fudge\r
1211       factor accounts for cumulative error when repeatedly adding a delta to\r
1212       the X (Y) value.\r
1213 \r
1214       Notes: The bug report was writing about Y tick counts only, but X tick\r
1215       counts can also be wrong. The proposed fix in the bug report does not\r
1216       work in all cases.\r
1217 \r
1218       This fix changes the appearance of many plots which were missing the\r
1219       top-most Y tick mark. The extra X-tick mark problem is less common.\r
1220 \r
1221 ===== Released as 5.0rc3 =====\r
1222 \r
1223 2006-11-13 (lbayuk)\r
1224     * Fix for bug 1437912: x-axis label misalignment [bar charts]\r
1225       The calculations were redone from scratch.\r
1226       New control variable 'bar_extra_space', which works in addition to\r
1227       'group_frac_width' to control how much extra space is around the bars.\r
1228       Made bar widths match for 'stackedbars' and 1-bar-per-group 'bars'.\r
1229 \r
1230       NOTE: This changes the appearance of charts. bars in 'stackedbars'\r
1231       will now be thinner, and bars in 'bars' graphs will be thicker. I\r
1232       saw no reason for them being different before.\r
1233 \r
1234       This fix required fixing the positioning on the new bar data labels,\r
1235       which was off before.  The bar data labels will now be centered.\r
1236       Additional fixes to bar chart data labels:\r
1237          For negative values, the label will center under the bar.\r
1238          Fixed X-adjustment to account for shading.\r
1239          Fixed to not suppress the data label if the value is 0.\r
1240 \r
1241 \r
1242 2006-11-10 (lbayuk)\r
1243     * Fix for bug 1594457: DrawError text wrap and background fix\r
1244       Do error image white background correctly, and word-wrap the text.\r
1245 \r
1246     * Fix for bug 1594458: Suppress lines or points in 'linepoints' \r
1247       Don't draw X data labels twice for 'linepoints'.\r
1248       Allow SetPointShapes value 'none' to suppress points, and allow\r
1249       SetLineStyles value 'none' to suppress lines. This allows a 'linepoints'\r
1250       graph to mix lines only, points only, and both on the same graph.\r
1251 \r
1252 \r
1253 2006-11-09 (lbayuk)\r
1254     * Fixes for bug 1446523:\r
1255       + Wrong variable name in deprecated SetAxisFontSize()\r
1256       + Fails to properly handle error if SetDataValues() was never\r
1257         called, or not called with a data array.\r
1258 \r
1259     * Fix for bug 1117122: Pie Chart ignores SetPlotAreaPixels\r
1260       Don't let DrawGraph recalculate the plot area for pie charts if the\r
1261       user already set it with SetPlotAreaPixels.\r
1262 \r
1263       NOTE: This fix may slightly change the appearance of some pie charts,\r
1264       whether or not they use SetPlotAreaPixels.\r
1265 \r
1266     * Fix for bug 1103992: Wrong max Y calculated for stackedbars\r
1267       Changes FindDataLimits to calculate max Y correctly. It was counting\r
1268       the first Y value in each record twice, which is always wrong but\r
1269       only affected stackedbars because the Y values are summed.\r
1270 \r
1271     * Fix for bug 1096199: Wrong error bar colors in DrawDotsError.\r
1272       Rewrites DrawDotsError to make it work like DrawLinesError to\r
1273       correctly increment the record and color indexes.\r
1274       Also fixes uninitialized x_now_pixels.\r
1275 \r
1276     * Fix for bug 1096197: No borders on unshaded Draw[Stacked]Bars\r
1277       Unshaded Bars and StackedBars covered the border with the rectangle.\r
1278       The fix is to draw the rectangle, then the border.\r
1279 \r
1280       NOTE: This fix changes chart appearance. Bars and Stacked Bars\r
1281       will now get a black border around each bar by default, if you\r
1282       turn off the 3D-shading. If you want borderless, unshaded bars\r
1283       you need to use SetDataBorderColors to set the data border colors\r
1284       to be the same as the data colors.\r
1285 \r
1286     * Fix for bug 1333164: Negative data values, if string variables, result\r
1287       in unfilled bars. The problem was a string-to-string compare of a\r
1288       negative number with the empty string x_axis_position. Fixed by\r
1289       initializing x_axis_y_pixels to 0 if SetXAxisPosition was not used.\r
1290 \r
1291 \r
1292 2005-04-17 (afan)\r
1293     * Fix for bug [ 1161072 ] SetInputFile warning, background overwrite\r
1294 \r
1295     * Bug 1182672 fixed\r
1296 \r
1297 2005-04-15 (afan)\r
1298     * fix for bug: [ 1182666 ] Y Auto-scale rounds in wrong direction\r
1299 \r
1300     * Fix for bugs 1144644 TrueType font path problems and 1106328 TTF\r
1301       path/filename inconsistency\r
1302 \r
1303     * Fix Bug: [ 1117120 ] X Title sizing uses Y Title font height\r
1304 \r
1305 2005-04-13 (afan)\r
1306     * Error in SetLineStyles() - does not accept an array argument\r
1307 \r
1308 \r
1309 2005-03-29 (afan)\r
1310     * Small typo fixed in SetYDataLabelPos\r
1311 \r
1312     * Update SetDataLabelPos: For past compatibility we accept plotleft,\r
1313       ...but pass it to SetTickLabelPos\r
1314 \r
1315 2005-03-26 (afan)\r
1316     * Change to line 3802: data lables now work with multiple bars with *$idx\r
1317 \r
1318 2005-03-25 (afan)\r
1319     * Added Function DrawDataLabels to put data labels in world coords,\r
1320       added call from DrawBars and modified SetYDataLabelPos to flag\r
1321       whether or not to call DrawDataLabels.\r
1322 \r
1323 2005-01-20 (migueldb)\r
1324     * Many bugfixes reported and solved by L. J. Bayuk. Thanks!\r
1325       + fixed bug #1096190\r
1326       + FindDataLimits(): fixed bug #1096192\r
1327       + CalcTranslation(): fixed bug #1101317\r
1328       + DrawImageBorder(): fixed bug 1096200\r
1329       + DrawXDataLabel(): fixed bug 1099879\r
1330       + DrawDots(): fixed bug #1096194\r
1331 \r
1332 ===== Released as 5.0rc2 =====\r
1333 \r
1334 2004-10-24 (migueldb)\r
1335     * array_merge_php4(): added to cope with the bug introduced by\r
1336         the change in array_merge() from PHP4 to PHP5 (I haven't verified this)\r
1337     * Fixed some divisions by zero, thanks to an old bug report.\r
1338 \r
1339 2004-09-09 (migueldb)\r
1340     * SetPointSize(): deprecated\r
1341     * SetPointSizes(): added as replacement for SetPointSize().\r
1342       Now able to set point sizes on a per line basis.\r
1343     * SetPointShape(): deprecated.\r
1344     * SetPointShapes(): added as replacement for SetPointShape().\r
1345       Now able to set point shape on a per line basis.\r
1346     * DrawDot(): now needs record number to decide which dot shape and\r
1347       size to draw.\r
1348     * CalcMargins(): dirty fix for x data label placing.\r
1349     * tile_img(): fixed tile placement.\r
1350 \r
1351 2004-06-14 (migueldb)\r
1352     * SetXTickLabelPos() and others: more on the bug reported by Jo Demol.\r
1353     * Fixed bug reported by Jo Demol.\r
1354 \r
1355 2004-05-11 (migueldb)\r
1356     * SetBgImage(): added.\r
1357     * SetPlotAreaBgImage(): added.\r
1358     * SetInputFile(): deprecated.\r
1359     * DrawBackground(): now accepts images as backgrounds.\r
1360     * DrawPlotAreaBackground(): now accepts images as backgrounds.\r
1361     * tile_img(): internal method added.\r
1362 \r
1363 ..........\r
1364 Editor's Note: For older changes to PHPlot, please see the CVS logs.\r