SVGGraph 2.10
Published
This updated version contains a whole load of changes, and a few new graph types
too. The new CylinderGraph
is shown below, and there are also new
StackedBar3DGraph
and GroupedBar3DGraph
classes for
3D versions of the stacked and grouped bar graphs.
The shading to add depth to the sides of the cylinders in the graph above is
also switched on by default in the updated 3D pie graphs. They both use a
horizontal gradient which can be modified with the new
depth_shade_gradient
option. I've improved gradient handling
throughout the library, so gradients can now be used as the background for the
whole graph, for the grid area, and also for the legend and tooltips.
One huge change in this version is that I've set a fixed default colour set for the bars, pie slices, etc. In earlier versions the colours were chosen at random from the list of named colours supported in the SVG specification, but quite often the colours selected were not very helpful. The new colours are blue, red, yellow, green, orange and the same again in a darker shade.
The scatter graphs have a few new options for drawing best-fit or trend lines. At the moment this only supports drawing the straight line that best matches the values, but I hope to build on this in future versions.
In the last version of SVGGraph I put some effort into improving the padding for the axis text, and this version takes another step in that direction. While version 2.9 found the largest string on the axis and used it to calculate the space, version 2.10 finds the bounding box of all axis text instead. This means that text overlapping the start and end of the axis is also taken into account.
Pierre-Sylvain Luquet sent me some patches to improve text positioning on the
radar graphs, support multi-line data keys and add show_axis_h
and
show_axis_v
options, which I merged in with the text spacing
changes I had already been working on. The multi-line keys are particularly
useful.
One more new option is minimum_units_y
, which can be used to set
the Y axis to only show full units. The default is 0 to use whatever value
fits best, but setting it to 1 will force SVGGraph to number the axis in whole
numbers. You can try other values, but it might cause strange side effects - the
option is passed through to the Axis class which already uses a fixed minimum
unit value of 1 for the X axis and I haven't tested it extensively with other
values.
There are a few bugs fixed in this version. Graphs with all values negative would show the “Zero length axis” message before. Scatter graphs now support drawing associative data by using the array position as the X coordinate. Dragging the legend should not select text under the cursor any more. Tooltips in graphs embedded in HTML5 or XHTML were being positioned incorrectly. 3D pie graphs with a slice taking exactly the bottom 50% had a missing side.
The updated zip and tar files are available from the downloads page.
« Previous: Using the new TagCanvas centreFunc option Next: TagCanvas 1.19.1 »