Blame | Last modification | View Log | RSS feed
This is the NEWS file for PHPlot, with release documentation.The project web site is http://sourceforge.net/projects/phplot/The project home page is http://phplot.sourceforge.net/Refer the the ChangeLog file for detailed source changes.See NEWS_part1.txt for older release documentation.-----------------------------------------------------------------------------2015-11-01 Release 6.2.0=== Overview:This is the current stable release of PHPlot. This is the first releasethat will work with the upcoming PHP-7. This release also adds two new plottypes.The PHPlot Reference Manual has been updated to match this release.=== Cautions, Important Notes, and Compatibility Issues:PHP-7 deprecated use of older-style class constructor method names, wherethe constructor name matches the class name. The PHPlot class constructorname in this release has been fixed to work with PHP-7. This releasealso works with PHP-5.4, 5.5, and 5.6. However, there is a compatibilityissue with extended classes. This applies even if you are using PHP-5.If you define a class which extends the PHPlot class, you must use thissyntax to call the PHPlot constructor from your class constructor:parent::__construct(...); // Call parent class constructorThis syntax also works in previous releases of PHPlot. However, thefollowing syntax also worked in older releases, and will no longer work:$this->PHPlot(...); // Do Not Use This to call parent class constructoror: parent::PHPlot(...); // Do Not Use This EitherYou must use the correct syntax parent::__construct() even if using PHP-5.If you are using PHP-7 with PHPlot, here are a few other items to be aware of.(Some of these affected the PHPlot test suite.)+ PHPlot uses is_numeric() to check for missing points in the data array.Starting with PHP-7, hexadecimal strings are no longer considered numeric.This means if your data array contains the string "0x10", for example, PHPlotwill consider that to be the number 16 when using PHP-5.x, but will treat itas a missing point with PHP-7. (Unquoted hexadecimal values are still numbers.)+ PHP-7 no longer allows multiple function parameters with the same name.A typical case which fails in PHP-7 is:function myfunction($s, $unused, $unused); // Fails in PHP-7This broke some PHPlot Test Suite scripts that implemented PHPlot callbackswith unused parameters.+ New objects cannot be assigned by reference. Very old versions of thePHPlot Reference Manual had this syntax (and there may still be some oldversions out there):$plot =& new PHPlot(600, 400); // Do not use &+ Division by zero no longer results in E_WARNING, but you end up with oneof the special float values +INF, -INF, or NAN instead.=== Bugs Fixed in 6.2.0:Fixed bug #170 "replace eval() ...":This was a request to remove use of eval() from SetDashedStyle(), becauseeval() makes people nervous about security, and is not supported by someVirtual Machines. Removed eval() by using a string template instead of acode string for the dashed line pattern. There are no changes in usage orbehavior.Fixed bug #172 "Fixes for PHP7":This release now works with PHP-7 (currently pre-release). The constructorname was changed; there were no problems with the rest of the code.(Although several scripts in the PHPlot Test Suite also had to be fixed.)Any class that extends PHPlot must now use the correct syntax to call theparent constructor: parent::__construct(...). If they used the old syntax$this->PHPlot(...) they will not work (even with PHP-5.x).=== New features in 6.2.0:Feature Request #55 "Method documentation in PHPDoc format":PHPlot now uses "phpdoc"-style comments in the code, which apparently issupported by some editors/IDEs. Note that the PHPlot Reference Manual doescurrently make use of these comments.Feature Request #56 "Hidden Y values when zero":The request was for a way to hide Y label values when zero, but theimplementation is much more general. When using 'printf' label formattingtype, you can now specify 1, 2, or 3 separate format strings. These areapplied in the same way spreadsheets support cell format strings: whichformat is used depends on the sign of the value.Feature Request #57 "squarefilled plot type":Two new plot types are added: 'squaredarea' and 'stackedsquaredarea'.These are like area and stackedarea, but the edges are stepped like'squared' plots.Feature Request #58 "Data borders for area plot types":After data borders support was added to the two new plot types 'squaredarea'and 'stackedsquaredarea', this was extended to the existing, similar plottypes 'area' and 'stackedarea'. Data borders are off by default for all 4plot types.-----------------------------------------------------------------------------2013-05-11 Release 6.1.0=== Overview:This is the current stable release of PHPlot. This release includes two newplot type features (which were not completed in time to make it intoPHPlot-6.0.0).The PHPlot Reference Manual has been updated to match this release.=== Cautions, Important Notes, and Compatibility Issues:There are no new compatibility issues in this release. However, ifupgrading from PHPlot-5.8.0 or older, please read the Cautions, ImportantNotes, and Compatibility Issues from the PHPlot-6.0.0 release. Everythingthere is still applicable.=== Bugs Fixed in 6.1.0:(none)=== New features in 6.1.0:Feature Request #47 "Extend horizontal plots to more types":This feature request was mostly implemented in PHPlot-6.0.0, except forhorizontal error plots, which are now implemented. A new data type'data-data-yx-error' is used for horizontal error plots of type lines,points, and linepoints.Feature request #52 "Box Plots":A new plot type 'boxes' is added. This produces a Box Plot, which is usedto present a 5-number statistical summary of a data set.-----------------------------------------------------------------------------2013-04-03 Release 6.0.0=== Overview:This is the current stable release of PHPlot. This release includes asignificant rewrite how PHPlot automatically calculates the plot area rangeand tick increments from the data points. A number of new features and bugfixes are also included.The PHPlot Reference Manual has been updated to match this release. Apreviously-experimental feature to help create HTML image maps is nowfully documented in the manual.=== Cautions, Important Notes, and Compatibility Issues:There are some important compatibility issues you need to be aware ofbefore upgrading to PHPlot-6.0.0 from any previous version. Many scriptswill produce different-looking plots with PHPlot-6.0.0 compared to earlierversions. This is mostly due to changes in the automatic plot range andtick increment calculations. Also, some scripts may fail, if they accessPHPlot class internal variables (properties) which have been changed tohave 'protected' visibility. See the details below.+ Plot range calculations changedPHPlot-6.0.0 uses a completely new method to calculate each of the 4 limitsof the plot area which are not defined using SetPlotAreaWorld(). As aresult, most plots that don't use SetPlotAreaWorld() with all 4 coordinatesgiven will look different under PHPlot-6.0.0. The two most notable changesare that PHPlot-6.0.0 will usually stretch the range to include zero (ifthe range does not already include zero), and under most conditions willensure that the X axis and Y axis both start and end at a tick mark position(even if tick marks and labels are not visible). See bug #101 below.+ Tick increment calculations changedPHPlot-6.0.0 uses a completely new method to calculate tick incrementsalong the X axis and Y axis. This only occurs if the tick increments havenot been set using SetXTickIncrement() or SetNumXTicks() for X, andSetYTickIncrement() or SetNumXTicks() for Y. If you let PHPlot calculatethe tick increments, your plot will likely have fewer or more tickintervals than before, and the tick increment will be different. Ingeneral, PHPlot-6.0.0 makes much better choices for tick increment.See bug #132 below.+ Class variable visibility changedMost PHPlot class variables now have 'protected' visibility, so they are nolonger accessible from scripts that use the class. If your script directlyaccesses PHPlot class variables - other than those documented in the manualfor 'tuning' - your script will not work with PHPlot-6.0.0. This change wasnecessary because some internal class variables change in each PHPlot release,and it is impossible to maintain compatibility with direct access to all theseclass variables. If your script breaks because of variable visibility changes,please: (1) see if you can use a public PHPlot class function instead, or(2) post a message to the PHPlot help forum explaining why you need access toa particular class variable.+ SetPlotAreaWorld() now validates argumentsStarting with PHPlot-6.0.0, the SetPlotAreaWorld() function checks non-NULLarguments for validity. For both X and Y, it is required that min < max ifboth are specified. If you have a script that calls SetPlotAreaWorld() withmax <= min for either X or Y, that script will now fail. On the other hand,some valid cases where you specify only one end of a range would previouslyfail and now work.+ SetRGBArray() now validates argumentIf you use SetRGBArray() to load a custom color map but pass an invalidargument (not an array or one of the known keywords), PHPlot will now failwith an error message. In previous releases, a default black/white colormap was loaded in that case, with no error reported.+ Removed order dependency: number of ticks and tick incrementIf you want to control the tick increments (rather than letting PHPlotcalculate them), you should set either the number of ticks (SetNumXTicks(),SetNumYTicks()) or the tick increment (SetXTickIncrement(),SetYTickIncrement()), but not both, for each axis. If you do set both,PHPlot-5.8.0 and earlier will use the last setting you made, and ignore theother. PHPlot-6.0.0 gives priority to the tick increment setting andignores the number of ticks, regardless of the order. (The new behavior isconsistent with the PHPlot design goal that you can use the various Set*()functions in any order and get the same plot.)=== Bugs Fixed in 6.0.0:Fixed bug #101 Fix automatic Y range calculations":PHPlot now calculates the Y (and X) ranges using a completely differentmethod, which is described in the manual. There are new functions to 'tune'the algorithm used, and of course you can still set the range limits manually.In most cases, PHPlot now makes much better choices for the plot range limits.Fixed bug #132 "Improve tick interval calculations":PHPlot now by default picks a tick increment which is 1, 2, or 5 times apower of 10, for much more 'natural' results. There are alternatealgorithms for selecting a 'binary' (power of 2) or date/time-based tickincrement instead. Rather than simply dividing the plot range by 10, PHPlotnow selects a tick increment based on the above requirement and whichresults in at least 8 (by default) tick intervals. Of course, you canstill specify the tick increment(s) directly.Fixed bug #164 "Calculated defaults applied to subsequent plots":This has been fixed for the cases of grid visibility, X data label angle,and label format. A new bug #168 was written for a remaining issue withlabel position defaults. This only apples when creating multiple plots on asingle image (overlay or side-by-side).Fixed bug #165 "Missing axis labels on some empty plots":In some cases, X axis labels would be absent for a plot with an empty dataarray. PHPlot will now draw the axis labels even when the data array is empty.Fixed bug #166 "Legend, UsePointShapes, and shape='none'":PHPlot will now fall back to using a point marker in the legend when doinga linepoints plot with a dataset using 'none' as the point shape (ratherthan doing no marker at all). This only applies with SetLegendUseShapes(True).Fixed bug #167 "Fails to find a default font on Ubuntu":Ubuntu (via Debian) changed the installation path for the TrueType fontthat PHPlot used as a default, causing font selection to fail. The newfont installation path has been added to the search list, and now PHPlotcan find the default TrueType font on Ubuntu.=== New features in 6.0.0:Feature request #29 "Finer control over plot element colors":This was an open-ended feature request that is partially implemented andnow closed. New functions were added to control element colors. (Some otherfunctions were added in previous releases.) In PHPlot-6.0.0, these functionswere added: SetLegendBgColor() for legend background color;SetLegendTextColor() for legend text color, and functions for pie chartborder colors (see feature request #46 below).Feature request #45 "Control pie chart start angle":Implemented with new functions SetPieStartAngle() and SetPieDirection().The angle for the first segment, and the direction (clockwise orcounter-clockwise) can now be set for pie charts.Feature request #46 "Control pie chart borders":Implemented with new functions SetDrawPieBorders() and SetPieBorderColor().Pie segment borders can now be on (default for unshaded) or off (default forshaded), and the color can be set independent of other elements.Feature request #47 "Extend horizontal plots to more types":This is partially implemented. Horizontal lines, linepoints, and points plotsare now implemented. Error plot versions of those horizontal plot types arenot yet implemented, but will probably be in the next release 6.1.0 (withthe introduction of a new data type).Note: In implementing feature request #47, the code for 'error' and'non-error' versions of the 3 plot types above were merged. A side effectof this is that data value labels (the labels within the plot area,identifying the data value at each point) now work for error plots, ifenabled. However, the default label position at 90 degrees will be crossedby the positive error bar. To avoid this, you can use the tuning variabledata_value_label_angle; for example setting it to 45 degrees.Feature request #50 "Control legend colorbox borders":Implemented with new function SetLegendColorboxBorders(). There are now 3choices for the borders around color boxes in the legend: 1) use the 'text'color (the default, and compatible with PHPlot-5.8.0 and older); 2) usedata border colors; and 3) disable the borders.Note: Along with the implementation of feature request #50, a new functionSetDrawDataBorders() was added to control drawing the data borders on barsand stackedbars plots. This supports having the same style (borders withmatching color, or no borders) on both the legend color boxes and the databars. The default is backward compatible: borders on unshaded plots, andno borders on shaded plots.Feature request #51 "Lines instead of colorboxes in legend":Implemented with existing function SetLegendUseShapes(). PHPlot now hasthe option of showing short line segments (with correct color and width) inthe legend, rather than color boxes. This applies to lines and squaredplots only.-----------------------------------------------------------------------------2012-04-06 Release 5.8.0=== Overview:This is the current stable release of PHPlot. This release adds several newfeatures, including the ability to generate "streaming plots" - a videostream showing updated plot data.The PHPlot Reference Manual has been updated to match this release.=== Cautions, Important Notes, and Compatibility Issues:There are no known compatibility issues in upgrading from PHPlot-5.7.0 tothis release. For issues with previous releases, see below in this file.=== Bugs Fixed in 5.8.0:Fix bug #3506408 "Data Label Lines vs new plot types":Data label lines do work with bubble plots. This is now documented. Datalabel lines did not work well with OHLC plot types. This was never documentedto work, and is now disabled.=== New features in 5.8.0:Feature request #3488042 "Display only some data value labels":Custom label formatting functions now have access to the data point row andcolumn for data value labels, and to the row for axis data labels. You cannow filter or modify labels based on their position in the data array.Documentation was updated.Feature request #3501500 "Looping plot section (updating plot data)":PHPlot can now produce "streaming plots", with updating data presented as aMotion-JPEG stream. Documentation has been added to the reference manual.Feature request #3515519 "Support object serialize/unserialize":You can now serialize and unserialize a PHPlot object, subject to someminor restrictions. Details are in the PHPlot Reference Manual.-----------------------------------------------------------------------------2012-02-25 Release 5.7.0=== Overview:This is the current stable release of PHPlot. This release includes severalbug fixes, new color controls for labels, a new feature for application-levelerror handling, and an experimental feature for creating plot image maps.The PHPlot reference manual has been updated to match this release.=== Cautions, Important Notes, and Compatibility Issues:This release includes a change in how the color is set for data valuelabels. (These are the labels inside the plot area that identify the topsof bars, for example.) This can change the color of some labels. See thebug report "Wrong color for data value labels" below.This release reverts a change from PHPlot-5.4.0 to stackedbars plots. Itaffects plots with stacked bar segments of size 0 that are at the top orend of a stack. Starting in PHPlot-5.4.0, a zero-size segment at the top orend would result in a color 'cap' on the bar stack, using the data color ofthe zero-size segment. In PHPlot-5.7.0 this has been fixed. This willchange the appearance of some stackedbars plots. See the bug report "Topdropshadow [sic] of stacked bars..."=== Bugs Fixed in 5.7.0:#3396931 "Top dropshadow of stacked bars is always the same color":PHPlot will no longer draw a color 'cap' at the top or end of a bar stackif the last segment has a 0 value. (The term 'dropshadow' isn't correct.)Drawing the color for zero-size segments started in PHPlot-5.4.0 as part ofthe fix for bug #3296884, but the behavior was unexpected, so it was reverted.In general, PHPlot will now ignore segments with size 0, and if a stackcontains all 0 values it will not be drawn. (The exception is if the axis ismoved.)#3488064 "Pie label failures in locales with comma decimal":Two work-arounds are implemented for what is essentially a PHP problem withlocales that use something other than a period (typically comma) for thedecimal separator. When formatting labels as type 'data', PHPlot loads thelocale settings to get the separator characters, but now it resets ('unloads')the settings afterwards. This helps avoid an error seen in PHPlot-5.6.0 withpie chart labels, where an incidental conversion of the label to a stringresulted in use of the comma separator, followed by PHP failing to convertthe number back to floating point because of the comma. The secondwork-around is to avoid the conversion to string, in the case where the pielabel has a single value. Together, these work-arounds should prevent theproblem, but this is an imperfect fix.#3486834 "Wrong color for data value labels":PHPlot was using the 'title' color (SetTitleColor()) for data value labels,which was wrong, as the title color is for the 3 plot title strings. PHPlotwill now use the general text color (SetTextColor()) for data value labels,same as tick labels and axis data labels. This will change the appearanceof some plots. In order to help with the compatibility issue, 4 newfunctions are introduced to control the colors of individual label types:SetTickLabelColor(), SetPieLabelColor(), SetDataLabelColor(), andSetDataValueLabelColor(). The defaults have been set up to be compatible(except for data value labels). Details are in the PHPlot Reference Manual.=== New features in 5.7.0:#3442041 "Provide data for generating image maps":An experimental feature has been added to allow a callback function toprocess the coordinates of individual plotted data points. This is mostuseful for generating an HTML image map for the plot. Refer to the textfile Imagemaps.txt included in the PHPlot release for details. Caution:This is an experimental feature. It is subject to change, and not yetdocumented in the reference manual.#3481195 "Custom message image":A new function DrawMessage() has been implement for special cases where youneed to display an image containing a message, rather than a plot. Thisextends the PHPlot error reporting mechanism, and is intended forapplication-level errors. More information and an example can be foundin the PHPlot Reference Manual.-----------------------------------------------------------------------------2012-01-02 Release 5.6.0=== Overview:This is the current stable release of PHPlot. This release includessignificant changes to pie charts. There are new ways to label pie charts,and PHPlot does a better job calculating the size and positioning the labels.The PHPlot reference manual has been updated to match this release.=== Cautions, Important Notes, and Compatibility Issues:Pie charts will change appearance when you upgrade to PHPlot-5.6.0 from anyprevious release. This is due to changes resulting from bug #3403297,described below. You may notice these changes:1. The pie chart itself will usually be drawn larger, taking up more ofthe image. This may result in interference with a plot legend.2. Pie chart labels will be closer to the edge of the pie, if you are lettingthe label positions default. If you are using SetLabelScalePosition() toset the label positions, the results may vary even more.3. Text alignment on pie chart labels will change.4. World Coordinates are now undefined with pie charts.If you are producing pie charts with PHPlot, you should review the outputof your scripts before using PHPlot-5.6.0 in production. If the output isnot acceptable, one or more of these steps might help:1. If pie charts are too large, and/or interfere with a legend, try moving thelegend. Alternatively, use SetPlotAreaPixels() or SetMarginsPixels() tolimit the plot area. Note, however, that starting in this release PHPlotsizes the pie so the labels fit inside the plot area too. You can controlthis with SetPieAutoSize().2. If you want labels positioned just outside the pie chart, do not callSetLabelScalePosition(), or set the value to the default 0.5. If you wantlabels just inside the pie, use 0.49. If you want labels to be abouthalf-way inside the pie, use 0.25. (In previous releases, PHPlot multiplethe label scale position by 1.2 before using it to position the labels,but this was not documented.)3. Your pie chart script will report errors if you use GetDeviceXY(),SetLegendWorld(), or SetLegendPosition(...,..., 'world'). This is becausethese functions require world coordinates, and world coordinates are notdefined for pie charts. (Previous releases did define a world coordinatespace for pie charts, but the values were meaningless.)=== Bugs Fixed in 5.6.0:#3403297 Pie chart sizing and label issues:In addition to the fixes listed here, new features were added as a resultof this bug fix (see New features below).+ Use both width and height of the pie when calculating its maximum size.(The bug was that the pie diameter would be sized to fit in the smallerof the image width and height. But a shaded pie is oval, so when the widthif the pie was sized to the height of the image, the pie was too small.)+ Fixed the text alignment of pie labels so they extend more naturallyaway from the pie chart (if outside the pie). (Don't just use center/centeralignment for all labels.)+ Do not multiply the label scale position by 1.2 in the hope that this willprevent labels from overlapping the pie. Use the label scale positionas intended, and take other measures to prevent label overlap (such asfixing the text alignment).+ Label positions along the bottom of the pie are now adjusted to account forthe pie shading depth.+ Plot area borders now work with pie charts. Use SetPlotBorderType() toenable them. The default is not to draw borders.=== New features in 5.6.0:A number of new features were added as a result of bug #3403297, describedabove. The new features are:+ Use the new function SetPieLabelType() to select the type of pie labelsto be displayed. Labels can show segment percentages, segment values,string labels, or any other value using a custom function.+ SetPieLabelType() also allows control over formatting of pie labels,similar to the way X and Y tick and data labels can be formatted.+ Plot labels can be suppressed with SetLabelScalePosition(0).+ The aspect ratio of shaded pies can be controlled with a tuning variable$pie_diam_factor. The default remains 0.5, making the pie height equal tohalf its width.#413925 Table of values:This very old feature request was implemented by adding a new script to the"contrib" directory. The data_table.php script contains a function to drawa simple table of values on a PHPlot image. Examples are provided.-----------------------------------------------------------------------------For older releases, see NEWS_part1.txt