New features in eZ Components Graph 1.3 - Kore Nordmann

New features in eZ Components Graph 1.3

The drivers in the graph component are called by the renderers and transform image primitives, like a rectangle, circle, or similar, into actual images. The graph component currently supports Flash, GD, SVG and - since this release - Cairo drivers.

Cairo driver

Cairo is a software library used to provide a vector graphics-based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration when available.

Cairo is currently one of the fastest and best 2D drawing libraries, used by Gnome, Firefox 3 and may others to render high quality graphics. Cairo is also available in PHP through the pecl/cairo_wrapper by Hartmut and now also in the graph component by the new driver ezcGraphCairoDriver.

As shown earlier cairo is the fastest rendering tool in PHP, and produces the best output. It supports everything we need in graph, like (transparent) gradients, perfect anti aliasing and different fonts. Even the extension it depends on is still beta you should definitely give it a try.

SVG driver

Thanks to Freddie Witherden we now got support for glyphs in SVG. Glyphs are used in the SVG driver to provide paths for characters. This allows us to finally estimate the exact space consumed by texts which is a really great enhancement for the SVG support in the graph component.

To use this feature, you just need to assign a SVG font, instead of just a name of a font. In case of a font name, the client actually renders the text, and this depends a lot on the actual client so we weren't able to exactly estimate where the text will end up. The SVG font may be created using ttf2svg from apache batik, which basically converts all characters defined in a TTF font into paths, which then can be embedded in the created SVG document.

Subsumption

As a result the Cairo and SVG driver now support everything you need to generate perfect and beautiful charts. Both features are available in the latest stable release, which has just been announced.